This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## this method of keyremapping was found: https://apple.stackexchange.com/a/283253/28701 | |
## all key keycodes: https://developer.apple.com/library/content/technotes/tn2450/_index.html | |
## | |
# remap right option to forward delete | |
hidutil property --set '{"UserKeyMapping": | |
[{"HIDKeyboardModifierMappingSrc":0x7000000e6, | |
"HIDKeyboardModifierMappingDst":0x70000004c}] | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function pressFn(mods, key) | |
if key == nil then | |
key = mods | |
mods = {} | |
end | |
return function() hs.eventtap.keyStroke(mods, key, 10) end | |
end | |
local function remap(mods, key, pressFn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- http://alignedleft.com/tutorials/d3/making-a-bar-chart --> | |
<div class="container"> | |
<style type="text/css"> | |
div.bar { | |
display: inline-block; | |
width: 20px; | |
height: 75px; /* Gets overriden by D3-assigned height below */ | |
margin-right: 2px; | |
background-color: teal; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myClass = function(constructorParam) { return { | |
/** object notation properties **/ | |
x: "it ", | |
_state: 'awesome', | |
/** Getters and setters! **/ | |
get state() { | |
return this._state; | |
}, | |
set state(value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The Nil object behaves similarily to nil in Objective-C. You can infinitely | |
chain calls or property accessors on it and it will never throw an exception. | |
I developed this for unit testing. | |
Example usage: | |
var nil = new Nil(); | |
console.log(nil.infinitelyChainsCalls().or.properties.withoutRepercussions()); | |
Based on code from http://stackoverflow.com/a/29723887/337934 | |
Proxy documentation: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Proxy | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
db.execute("CREATE TABLE Test (test_id INTEGER NOT NULL);") | |
db.execute("INSERT INTO Test (test_id) VALUES (1);") | |
tables = db.select(table="sqlite_master", where="type = 'table'", columns="name") | |
self.assertTrue(len(tables) == 1) | |
for table in tables: | |
db.execute("DROP TABLE " + table['name']) | |
tables = db.select(table="sqlite_master", where="type = 'table'", columns="name") | |
self.assertTrue(len(tables) == 0) | |
except Exception as e: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"auto_complete": true, | |
"caret_style": "solid", | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
"folder_exclude_patterns": | |
[ | |
".git", | |
"doc" | |
], | |
"font_size": 13, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thanks to plasmarob (http://unix.stackexchange.com/a/285956) | |
function colorgrid( ) | |
{ | |
iter=16 | |
while [ $iter -lt 52 ] | |
do | |
second=$[$iter+36] | |
third=$[$second+36] | |
four=$[$third+36] | |
five=$[$four+36] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// completion shortcut: @propstrong | |
@property (nonatomic, strong) <#type#> *<#name#>; | |
// completion shortcut: @propweak | |
@property (nonatomic, weak) <#type#> *<#name#>; | |
// completion shortcut: @propassign | |
@property (nonatomic, assign) <#type#> <#name#>; | |
// completion shortcut: dispatch_async | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
<#code#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"" Important installed plugins: | |
"" | |
"" YouCompleteMe | |
"" http://www.alexeyshmalko.com/2014/youcompleteme-ultimate-autocomplete-plugin-for-vim/ | |
"" | |
"" Airline status bar | |
execute pathogen#infect() | |
"" |