This file contains hidden or 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 gnuplot | |
set terminal png size 1024,768 font "/Library/Fonts/Arial.ttf" 12 | |
set output "output.png" | |
set style line 1 lt 1 lw 2 pt 7 pi -1 ps 1.5 | |
set pointintervalbox 3 | |
set datafile separator ',' |
This file contains hidden or 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 Text.ParserCombinators.Parsec | |
import Text.Parsec.Char | |
import Data.List.Split (chunksOf) | |
data Exp = IntExp Integer | |
| SymExp String | |
| SExp [Exp] | |
deriving (Show) | |
data Val = IntVal Integer |
This file contains hidden or 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
class NilClass | |
include Enumerable | |
def [](index) | |
self | |
end | |
def merge(hash) | |
hash.dup | |
end |
This file contains hidden or 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
// Assume a < b | |
void swap(int &a, int &b) | |
{ | |
if(a < b) { | |
a++; | |
swap(a, b); | |
b--; | |
} | |
} |
This file contains hidden or 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
on run {input, parameters} | |
tell application "Mail" | |
set theWindow to front window | |
set miniaturized of theWindow to true | |
end tell | |
set question to display dialog "Sending Mail" buttons {"Send Now", "Stop"} default button 2 giving up after 12 | |
set answer to button returned of question | |
tell application "System Events" |
This file contains hidden or 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
x = true and false | |
puts x # print out true | |
x = true && false | |
puts x # print out false |
This file contains hidden or 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
for(i = 0; i < 5; i++) { | |
var times = i; // need to save this in our closure | |
String.prototype["alert" + i] = function() { | |
alert(this + times); | |
} | |
}; | |
"foobar".alert3() |
This file contains hidden or 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
class Bank | |
def bank_balance(account_number) | |
42 | |
end | |
end | |
bank = Bank.new | |
p bank.bank_balance("1234567") # ---> Gives me 42 |
This file contains hidden or 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 command_not_found_handle() { | |
gem install "$@" || sudo apt-get install "$@"; | |
} |
NewerOlder