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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<script> | |
var pretag = document.createElement("pre"); | |
pretag.innerHTML = document.getElementsByTagName("html")[0].outerHTML.replace(/[\u00A0-\u9999<>\&]/gim, function(i) { | |
return '&#'+i.charCodeAt(0)+';'; | |
}); | |
document.body.appendChild(pretag); | |
</script> |
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
<!-- Created for my INFO 360 project ProcrastiNo --> | |
<!-- Based on code from http://jsfiddle.net/Mandarinazul/WMLd4/ --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<body> | |
<style> | |
div { | |
font-family: Tahoma, Verdana sans-serif; | |
box-sizing: border-box; | |
-moz-box-sizing: border-box; |
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
######### | |
## Git ## | |
######### | |
# search diff of dangling commits for the word AVCaptureDevice | |
git fsck --no-reflog | awk '/dangling commit/ {print $3}' | \ | |
while read ref; do if [ "`git show -p $ref|grep -c AVCaptureDevice`" -ne 0 ]; then echo $ref ; fi ; done | |
# list git commit messages for dangling commits | |
git fsck --lost-found | grep "dangling commit" | cut -d" " -f 3 | xargs -I "{}" git show --stat "{}" # view git messages for dangling commits |
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
{ | |
"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
/* | |
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
<?xml version="1.0"?> | |
<root> | |
<appdef> | |
<appname>GOOGLE_CHROME</appname> | |
<equal>com.google.Chrome</equal> | |
</appdef> | |
<appdef> | |
<appname>TERMINAL</appname> |
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
// 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#> |
OlderNewer