Skip to content

Instantly share code, notes, and snippets.

@kjs3
kjs3 / US cities by state
Last active January 4, 2016 04:38
NSDictionary with state keys to NSArrays of NSString cities
@{
@"ALABAMA":
@[@"ABBEVILLE",@"ADAMSVILLE",@"ADDISON",@"AKRON",@"ALABASTER",@"ALBERTVILLE",@"ALEXANDER CITY",@"ALEXANDRIA",@"ALICEVILLE",@"ALLGOOD",@"ALTOONA",@"ANDALUSIA",@"ANDERSON",@"ANNISTON",@"ARAB",@"ARDMORE",@"ARGO",@"ARITON",@"ARLEY",@"ASHFORD",@"ASHLAND",@"ASHVILLE",@"ATHENS",@"ATMORE",@"ATTALLA",@"AUBURN",@"AUTAUGAVILLE",@"AVON",@"BABBIE",@"BAILEYTON",@"BANKS",@"BAY MINETTE",@"BAYOU LA BATRE",@"BEAR CREEK",@"BEATRICE",@"BEAVERTON",@"BELK",@"BENTON",@"BERRY",@"BESSEMER",@"BILLINGSLEY",@"BIRMINGHAM",@"BLACK",@"BLOUNTSVILLE",@"BLUE MOUNTAIN",@"BLUE RIDGE",@"BLUE SPRINGS",@"BOAZ",@"BOLIGEE",@"BON AIR",@"BRANCHVILLE",@"BRANTLEY",@"BRENT",@"BREWTON",@"BRIDGEPORT",@"BRIGHTON",@"BRILLIANT",@"BROOKSIDE",@"BROOKWOOD",@"BRUNDIDGE",@"BUTLER",@"BYNUM",@"CAHABA HEIGHTS",@"CALERA",@"CAMDEN",@"CAMP HILL",@"CARBON HILL",@"CARDIFF",@"CAROLINA",@"CARROLLTON",@"CASTLEBERRY",@"CEDAR BLUFF",@"CENTER POINT",@"CENTRE",@"CENTREVILLE",@"CHALKVILLE",@"CHATOM",@"CHELSEA",@"CHEROKEE",@"CHICKASAW",@"CHILDERSBURG",@"CITRO
@kjs3
kjs3 / gist:11222167
Created April 23, 2014 16:22
Chef-server install error on Ubuntu 12.04
Recipe: chef-server::bootstrap
* execute[verify-system-status] action run
================================================================================
Error executing action `run` on resource 'execute[verify-system-status]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '7'
@kjs3
kjs3 / gist:dad23fe79567219c85a7
Created June 17, 2014 14:37
Heroku fails to install node-sass
13740 info build /tmp/build_321c4633-54c2-4d0a-aff0-335d6f5953b0/node_modules/gulp-sass
13741 info preinstall gulp-sass@0.7.2
13742 verbose linkStuff [ false,
13742 verbose linkStuff false,
13742 verbose linkStuff false,
13742 verbose linkStuff '/tmp/build_321c4633-54c2-4d0a-aff0-335d6f5953b0/node_modules' ]
13743 info linkStuff gulp-sass@0.7.2
13744 verbose linkBins gulp-sass@0.7.2
13745 verbose linkMans gulp-sass@0.7.2
13746 verbose rebuildBundles gulp-sass@0.7.2
@kjs3
kjs3 / gist:65a435f3926ffdb4dd4c
Created June 17, 2014 15:53
Node-sass failing to install on Heroku
13682 info install uglify-js@2.4.14
13683 info postinstall uglify-js@2.4.14
13684 info build /tmp/build_321c4633-54c2-4d0a-aff0-335d6f5953b0/node_modules/gulp-uglify/node_modules/uglify-js/node_modules/async
13685 info preinstall async@0.2.10
13686 verbose linkStuff [ false,
13686 verbose linkStuff false,
13686 verbose linkStuff false,
13686 verbose linkStuff '/tmp/build_321c4633-54c2-4d0a-aff0-335d6f5953b0/node_modules/gulp-uglify/node_modules/uglify-js/node_modules' ]
13687 info linkStuff async@0.2.10
13688 verbose linkBins async@0.2.10
$ rvm install 2.2.0
ruby-2.2.0 - #removing src/ruby-2.2.0 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-2.2.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/kjs3/.rvm/rubies/ruby-2.2.0, this may take a while depending on your cpu(s)...
ruby-2.2.0 - #downloading ruby-2.2.0, this may take a while depending on your connection...
+__rvm_make:0> make -j 1
CC = gcc
LD = ld
LDSHARED = gcc -dynamiclib
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin14 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -install_name /Users/kjs3/.rvm/rubie
@kjs3
kjs3 / gist:a3c17b6e97b1f94948ee
Created May 19, 2015 17:12
Async mapi calls with js
var request = require('superagent');
var async = require('async');
var _ = require('lodash');
console.time('Execution Time');
baseUrl = "http://dev.mapi.move.com/properties/v1/search/"
limit = 20
@kjs3
kjs3 / gist:11f2032228de0f5a23bb
Created May 19, 2015 17:13
Async mapi calls with ruby
require 'typhoeus'
require 'pry'
Typhoeus::Config.memoize = false
t1 = Time.now
base_url = "https://dev.mapi.move.com/properties/v1/search/"
limit = 20
@kjs3
kjs3 / gist:047c1a2467a6d62bf223
Created June 16, 2015 03:19
Trying to set Parse User ACL
var user = new Parse.User({
name: name,
username: email,
email: email,
password: password
});
user.signUp().then(
function() {
var user = Parse.User.current();
@kjs3
kjs3 / server.js
Created December 3, 2015 20:26
Reloading express routes/middleware on file change WITHOUT restarting node process.
if ( process.env.NODE_ENV === 'production' ) {
// dev runs with babel-node so this isn't necessary
require('babel-core/register'); // this includes the polyfill
require('newrelic');
}
import 'source-map-support/register'
import Debug from 'debug'
import express from 'express'