Skip to content

Instantly share code, notes, and snippets.

View bronislav's full-sized avatar

Anton Ilin bronislav

  • Canada, Vancouver
View GitHub Profile
@arogulin
arogulin / VortexRace3ForMac.md
Last active March 19, 2025 12:19
How to setup Vortex Race 3 keyboard for Mac and move Fn key to Home

How to setup Vortex Race 3 for Mac with latest (on 2020-01-05) firmare V1.02.05.

For better understanding we will use the following naming convention:

  [ L1 ][ L2 ][ L3 ][ Space ][ R1 ][ R2 ][ R3 ]
  1. Reset everything by pressing L3+R1 for 5 seconds. Left LED will blink white color while you're holding the keys. Release them after it stopeed blinking.
  2. Get into one of the programmable layers (R2+RShift) – I like red, the super bright laser LED is the least super annoying in red.
  3. Put the keyboard in Windows Mode (Pn+W), it's the least problematic one.
@deanishe
deanishe / MoveMouse.js
Created August 21, 2016 12:13
JXA: Move mouse to centre of frontmost window
ObjC.import('stdlib')
ObjC.import('CoreGraphics');
// Move mouse cursor to specified position
function moveMouse(x, y) {
var pos = $.CGPointMake(x, y);
var event = $.CGEventCreateMouseEvent(null, $.kCGEventMouseMoved, pos, $.kCGMouseButtonLeft);
$.CGEventPost($.kCGHIDEventTap, event);
}
@kpheasey
kpheasey / 0000_packages.config
Last active September 16, 2019 21:56 — forked from gcarrion-gfrmedia/0000_packages.config
AWS Elastic Beanstalk Ruby 2.2 Puma Sidekiq
packages:
yum:
git: []
htop: []
@jimmycuadra
jimmycuadra / cloud-config.yml
Last active April 19, 2021 03:04
CoreOS cloud-config for DigitalOcean with iptables firewall
#cloud-config
coreos:
etcd:
# generate a new token for each unique cluster from https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/<token>
# multi-region deployments, multi-cloud deployments, and droplets without
# private networking need to use $public_ipv4
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
# IMPORTANT: this example is potentially out of date. The latest version can be found here: https://github.com/papertrail/remote_syslog2/blob/master/examples/remote_syslog.ebextensions.config
# See http://help.papertrailapp.com/kb/hosting-services/aws-elastic-beanstalk/
# Usage:
# - replace <VERSION> with the version of remote_syslog2 you want to use. Example: .../download/v0.14/remote_syslog_linux_amd64.tar.gz
# - replace <YOUR-TRACKED-FILES> with the files you want to monitor for new log lines. Example: - /var/log/httpd/access_log
# - replace <YOUR-APP-NAME> with the name of the application
# - replace <YOUR-LOG-DESTINATION> and <YOUR-PORT-NUMBER> with the values shown under log destinations: https://papertrailapp.com/account/destinations
sources:
@julionc
julionc / 00.howto_install_phantomjs.md
Last active February 1, 2026 03:05
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@ruckus
ruckus / statistics.sql
Created June 5, 2013 23:26
Postgres statistics queries
** Find commmonly accessed tables and their use of indexes:
SELECT relname,seq_tup_read,idx_tup_fetch,cast(idx_tup_fetch AS numeric) / (idx_tup_fetch + seq_tup_read) AS idx_tup_pct FROM pg_stat_user_tables WHERE (idx_tup_fetch + seq_tup_read)>0 ORDER BY idx_tup_pct;
Returns output like:
relname | seq_tup_read | idx_tup_fetch | idx_tup_pct
----------------------+--------------+---------------+------------------------
schema_migrations | 817 | 0 | 0.00000000000000000000
user_device_photos | 349 | 0 | 0.00000000000000000000
@asok
asok / gist:4352610
Last active December 10, 2015 00:39
Scenario: html-erb-mode not working
Given I have master of mmm-mode in "~/mmm-mode" directory
And I have file "test.el" with content:
'''
(add-to-list 'load-path "~/mmm-mode/")
(require 'mmm-auto)
(require 'mmm-erb)
(setq mmm-global-mode 'auto)
@vhazrati
vhazrati / GoogleDispatcher
Created August 2, 2012 10:18
Sign in with Google
package login
import net.liftweb.http.LiftRules
import net.liftweb.http.Req
import net.liftweb.http.GetRequest
import net.liftweb.http.S
import net.liftweb.common.Box
import net.liftweb.http.LiftResponse
import net.liftweb.util.Props
import net.liftweb.common.Full
import net.liftweb.common.Empty
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
charset = ENV["CHARSET"] || "utf8"
collation = ENV["COLLATION"] || "ut8_unicode_ci"
puts "Starting... charset will be set to #{charset}, collation to #{collaction}"
database_platform = YAML.load_file(File.join("config/database.yml"))[Rails.env]
database_platform.delete("socket")
ActiveRecord::Base.establish_connection(database_platform)
ActiveRecord::Base.connection.execute("ALTER DATABASE `#{database_platform['database']}` DEFAULT CHARACTER SET #{charset} COLLATE #{collation}\;")