Skip to content

Instantly share code, notes, and snippets.

View shanebo's full-sized avatar

Shane Thacker shanebo

View GitHub Profile
@shanebo
shanebo / brew_install_-v_v8cgi.log
Created July 24, 2011 02:55
brew install -v v8cgi
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
brew doctor
Your OS X is ripe for brewing.
Any troubles you may be experiencing are likely purely psychosomatic.
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
@shanebo
shanebo / console-output
Created May 11, 2013 19:17
RethinkDB homebrew install console logs related admin asset path issues.
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
@shanebo
shanebo / cordova.exec.shim.js
Created June 21, 2013 21:11
A cleaner PhoneGap/Cordova cordova.exec api.
/*
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)
@shanebo
shanebo / app.css
Last active October 19, 2017 19:38
test
#app {
background-color: #aae;
}
@shanebo
shanebo / timeLeft.js
Last active April 11, 2020 09:42
Simple seconds to hh:mm:ss functions
// 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);
@shanebo
shanebo / countries-with-states-provinces-regions
Created July 15, 2015 03:33
All countries with their states/provinces/regions in json
var countries = {
"Afghanistan": [
"Badakhshan",
"Badghis",
"Baghlan",
"Balkh",
"Bamian",
"Daykondi",
"Farah",
"Faryab",