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
# requires apt-get install -y automake pkg-config libpcre3-dev zlib1g-dev liblzma-dev | |
set -e | |
VERSION=0.16 | |
export LOCAL=$HOME/local | |
mkdir -p $HOME/build | |
cd $HOME/build |
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
#!/bin/sh | |
# Build Zsh from sources on Ubuntu. | |
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file. | |
# Some packages may be missing | |
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo | |
git clone git://git.code.sf.net/p/zsh/code | |
cd zsh |
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
def running_avg(): | |
total = float((yield)) | |
count = 1 | |
while True: | |
total += yield total / count | |
count += 1 | |
avg = running_avg() | |
avg.next() |
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
module CustomFieldsGenerator | |
# generate a number of custom fields based on the `@@field_types` | |
# this is to simulate a list upload | |
def self.generate(count) | |
pre_hash = @@field_enumerator.take(count) | |
Hash[pre_hash] | |
end | |
@@field_types = { |
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
require 'faker' | |
require 'enumerator' | |
class SecretSanta | |
def initialize(data) | |
@data = data | |
end | |
def perform | |
while !valid? |
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
class Something | |
constructor: -> | |
@delegateObject = new Messager | |
class Messager | |
testing: (int) -> | |
console.log int | |
woot: (bool) -> | |
console.log bool | |
nothing: (array) -> |
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 clone [email protected]:partkyle/prezto .zprezto | |
# link the prezto files | |
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do | |
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" | |
done |
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
#!/bin/sh | |
if [ -z "$VIM_VERSION"]; then | |
VIM_VERSION=v7-3-603 | |
fi | |
hg clone https://vim.googlecode.com/hg/ vim | |
cd vim | |
hg pull | |
hg update |
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 runApplication(){ | |
setInterval(doGameLoop, 1000 / 30); | |
} | |
function doGameLoop(){ | |
doLogic(); | |
renderScene(); | |
} |
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
// Basic function definition | |
function function_name (argument) { | |
// body... | |
} | |
function function_name (argument) | |
{ | |
// body... | |
} |