Skip to content

Instantly share code, notes, and snippets.

View nchapman's full-sized avatar

Nick Chapman nchapman

View GitHub Profile
@nchapman
nchapman / es.sh
Last active January 4, 2016 18:39
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.10.deb
sudo dpkg -i elasticsearch-0.90.10.deb
@nchapman
nchapman / hack.sh
Created April 27, 2013 05:01 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@nchapman
nchapman / gist:1862601
Created February 19, 2012 08:24 — forked from mudge/gist:1076046
CoffeeScript version of ActiveSupport's to_sentence method.
toSentence = (array = [], wordsConnector = ", ", twoWordsConnector = " and ", lastWordConnector = ", and ") ->
switch array.length
when 0 then ""
when 1 then array[0]
when 2 then array[0] + twoWordsConnector + array[1]
else array.slice(0, -1).join(wordsConnector) + lastWordConnector + array[array.length - 1]