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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
CFG_TZ = "US/Eastern" | |
# Provisioning script | |
node_script = <<SCRIPT | |
#!/bin/bash | |
dpkg -l oracle-java7-installer | |
[ $? -eq 0 ] && exit 0 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Update Test</title> | |
<script src="./js/usergrid.js"></script> | |
<script type="text/javascript"> | |
var restaurants; |
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
awk '{ if ( length > x ) { x = length } }END{ print x }' $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
package stringify | |
import( | |
"fmt" | |
"reflect" | |
) | |
func Stringify(v reflect.Value) string { | |
var str string | |
switch v.Kind() { | |
case reflect.Func: | |
case reflect.Map: |
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
# Add the Oracle JDK Repos | |
UBUNTU_VERSION=precise | |
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu ${UBUNTU_VERSION} main" | tee /etc/apt/sources.list.d/webupd8team-java.list | |
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu ${UBUNTU_VERSION} main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list | |
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 | |
DEBIAN_FRONTEND="noninteractive" apt-get update | |
# Accept the Oracle License | |
echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 boolean true" > /tmp/oracle-license-debconf | |
/usr/bin/debconf-set-selections /tmp/oracle-license-debconf |
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 Y = function(ƒ) { | |
return (function(x) { | |
return ƒ(function λ(y) { | |
return (x(x))(y); | |
}); | |
}) | |
(function λ(x) { | |
return ƒ(function λ(y) { | |
return (x(x))(y); | |
}); |
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
alias vb="VBoxManage" | |
alias ls='ls -GFh' | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
fill="--- " | |
reset_style='\[\033[00m\]' | |
red_style='\[\033[00;31m\]' | |
status_style=$reset_style'\[\033[0;90m\]' # gray color; use 0;37m for lighter color |
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
sudo apt-get install linux-image-extra-$(uname -r) -y | |
sudo apt-get install software-properties-common -y | |
sudo add-apt-repository ppa:dotcloud/lxc-docker | |
sudo apt-get update | |
sudo apt-get install lxc-docker -y |
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
// returns things in array 'a' that are not in array 'b' | |
// > ['a','b','c','1', '2', '3'].complement(['b', 'c', 'd', 'e']); | |
// ['a', '1', '2', '3'] | |
function complement(a, b){ | |
(b)||(b=a, a=this); | |
return (Array.isArray(a) && Array.isArray(b)) | |
? a.filter(function(x){return b.indexOf(x)===-1;}) | |
: undefined; | |
} | |
Array.prototype.complement=complement; |
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
/* | |
takes as parameters a method and any number of static arguments. | |
returns a function that will call the original function with these | |
arguments, plus any new arguments given | |
example: | |
function pow(exponent, base){ | |
return Math.pow(base, exponent); | |
} | |
var square=partial(pow, 2); |