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
// this has a max of 24 hrs | |
const timeLeft = (secs) => | |
new Date(secs * 1000) | |
.toISOString() | |
.substr(11, 8) | |
.replace(/^([00:])*/g, '') || '0'; | |
// this could be extended to include days | |
const timeLeft = (time) => { | |
const hrs = Math.floor(time / 3600); |
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
#app { | |
background-color: #aae; | |
} |
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
var countries = { | |
"Afghanistan": [ | |
"Badakhshan", | |
"Badghis", | |
"Baghlan", | |
"Balkh", | |
"Bamian", | |
"Daykondi", | |
"Farah", | |
"Faryab", |
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
/* | |
A cleaner PhoneGap/Cordova cordova.exec API: | |
native(plugin.action, args, success, fail); | |
plugin.action = dot plugin/action separated string | |
args = anything (optional) | |
success = function (optional) | |
fail = function (optional) |
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
brew update && brew install rethinkdb -v | |
Already up-to-date. | |
==> Downloading http://download.rethinkdb.com/dist/rethinkdb-1.4.5.tgz | |
Already downloaded: /Library/Caches/Homebrew/rethinkdb-1.4.5.tgz | |
tar xf /Library/Caches/Homebrew/rethinkdb-1.4.5.tgz | |
==> ./configure --prefix=/usr/local/Cellar/rethinkdb/1.4.5 | |
./configure --prefix=/usr/local/Cellar/rethinkdb/1.4.5 | |
* Detecting system configuration | |
Bash: 3.2.48(1)-release | |
Operating System: Darwin |
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 Api::ShowsController < ApiController | |
caches_page :index | |
def index | |
@shows = Show.order('id ASC').all | |
index = {} | |
@shows.each do |show| | |
show.image = show.image_url(:large) | |
index[show.id] = show |
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
brew doctor | |
Your OS X is ripe for brewing. | |
Any troubles you may be experiencing are likely purely psychosomatic. |
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
brew install -v v8cgi | |
Also installing dependencies: memcached, libmemcached | |
==> Downloading http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz | |
File already downloaded in /Users/shane/Library/Caches/Homebrew | |
/usr/bin/tar xf /Users/shane/Library/Caches/Homebrew/memcached-1.4.5.tar.gz | |
==> ./configure --prefix=/usr/local/Cellar/memcached/1.4.5 | |
./configure --prefix=/usr/local/Cellar/memcached/1.4.5 | |
checking build system type... i386-apple-darwin11.0.0 | |
checking host system type... i386-apple-darwin11.0.0 | |
checking target system type... i386-apple-darwin11.0.0 |