Skip to content

Instantly share code, notes, and snippets.

@KasaiMagi
KasaiMagi / gitflow-breakdown.md
Created July 12, 2018 19:07 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@KasaiMagi
KasaiMagi / init.lua
Last active December 18, 2015 18:30
Karabiner Switch when KB plugged in
local usbWatcher = nil
function usbDeviceCallback(data)
if (data["productName"] == "Quickfire TKL 6keys") then
if (data["eventType"] == "added") then
hs.execute('/Applications/Karabiner.app/Contents/Library/bin/karabiner select 1')
elseif (data["eventType"] == "removed") then
hs.execute('/Applications/Karabiner.app/Contents/Library/bin/karabiner select 0')
end
end
@KasaiMagi
KasaiMagi / private.xml
Created December 10, 2015 23:44
Karabiner - quickfiretk map
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>CM_Storm</vendorname>
<vendorid>0x2516</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>QuickFire_TK</productname>
<productid>0x0011</productid>
@KasaiMagi
KasaiMagi / sublime-keymap
Created October 15, 2015 16:47
OSX personal keymap
[
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} },
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} },
{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true } }
]
@KasaiMagi
KasaiMagi / backtrack.txt
Last active September 14, 2015 21:02
backtracking pseudocode
bool Solve(configuration conf) {
if (no more choices) { // BASE CASE
return (conf is goal state)
}
for (all available choices) {
try one choice C:
// solve from here, if works out, you're done
if (Solve(conf with choice c made)) return true;
unmake choice c;
@KasaiMagi
KasaiMagi / gen.js
Last active August 26, 2015 18:32
Generator vs Closure example
function* genColor() {
const colors = ['#5cb8d6', '#79d4f2', '#ffc425', '#f2dd6a', '#4ac327', '#87db42', '#ef9520', '#f6c452', '#41c3c0', '#65e1dd', '#6ca1b6', '#8cc1d7', '#16bb93', '#44debb']
let index = 0
while(true) {
yield colors[index]
index++
if (index >= colors.length) {
index = 0
}
function foo(x, y) {
ajax(
"http://some.url/?x=" + x + "&y=" + y,
function(err, data) {
if (err) {
it.throw(err);
} else {
it.next(data);
}
}
@KasaiMagi
KasaiMagi / emotes.txt
Last active October 15, 2018 17:34
emotes
༼ つ ◕_◕ ༽つ giff diretide
༼ つ ◕◡◕ ༽つ got diretide
(╯°□°)╯︵ ┻━┻
ʕ •ᴥ•ʔ
┬─┬ ノ( ゜-゜ノ)
_____.
~(_]---'
/_(U
(ง ˘ᴗ˘ )ว
(ว ˘ᴗ˘ )ง
@KasaiMagi
KasaiMagi / spec_keybindings.cfg
Created August 5, 2013 03:16
Dota 2 spectator keybindings For use with Player Perspective camera assigning 1-0 to players on the top of the screen. Faster than clicking on them.
//
// Spectator Hero Keys Dota 2 Config
//
// by Naikoh
//
bind "1" "dota_spectator_hero_index 0"
bind "2" "dota_spectator_hero_index 1"
bind "3" "dota_spectator_hero_index 2"
@KasaiMagi
KasaiMagi / gmradius.sql
Last active December 17, 2015 07:58 — forked from anonymous/gist:5576377
# INITIAL QUERY
SELECT *,
(
(
ACOS(
SIN($LAT * Pi() / 180)
* SIN(latitude * Pi() / 180)
+
COS($LAT * Pi() / 180)
* COS(latitude * Pi() / 180)