Shortcut | Command |
---|
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
function fib(num) { | |
if (num === 0) { | |
return 0 | |
} | |
if (num === 1 || num === 2) { | |
return 1 | |
} | |
let a = 1 |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
actions: { | |
clickOutside(event) { | |
const $target = Ember.$(event.target); | |
const clickedOutside = typeof $target.data('outside') !== 'undefined'; | |
alert("Clicked outside: " + (clickedOutside ? "yes" : "no")); | |
}, |
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
// IFEE | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript#Functions | |
var message = 'hello IFEE'; | |
(function(arg1) { | |
console.log(arg1); | |
}); |
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
#!/usr/bin/env python | |
from subprocess import call | |
import sys | |
# Taken from http://stackoverflow.com/questions/377017/test-if-executable-exists-in python | |
def which(program): | |
import os | |
def is_exe(fpath): | |
return os.path.exists(fpath) and os.access(fpath, os.X_OK) |
#Mac OS X
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
# Download Apps | |
# Chrome, Sublime Text, Adium, iTerm2, Disk Inventory X | |
# install Xcode ... manually.. | |
# then get Command Line Tools https://developer.apple.com/downloads/index.action | |
# oh my zsh | |
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh | |
# node |
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
# Set Up Your Sound Card | |
aplay -l && | |
alsamixer | |
speaker-test && | |
cd /etc/modprobe.d && | |
echo "Look for this line && comment out: options snd-usb-audio index=-2" | |
sudo nano alsa-base.conf |
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
/* | |
Three gods A, B, and C are called, in no particular order, True, False, and Random. | |
True always speaks truly, False always speaks falsely, but whether Random speaks truly or falsely is a completely random matter. | |
The gods understand English, but will answer all questions in their own language, in which the words for yes and no are da and ja, in some order. You do not know which word means which. | |
*/ | |
(function() { |
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
.-'---`-. | |
,' `. | |
| \ | |
| \ | |
\ _ \ | |
,\ _ ,'-,/-)\ | |
( * \ \,' ,' ,'-) | |
`._,) -',-') | |
\/ ''/ | |
) / / |