Skip to content

Instantly share code, notes, and snippets.

Kenny Smith kjs3

Block or report user

Report or block kjs3

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kjs3
kjs3 / server.js
Created Dec 3, 2015
Reloading express routes/middleware on file change WITHOUT restarting node process.
View server.js
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'
@kjs3
kjs3 / md-link-processing.md
Last active Aug 14, 2017
Markdown link processing
View md-link-processing.md
View git-setup.sh
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1 HEAD'
git config --global push.default current
View Preferences.sublime-settings
{
"file_exclude_patterns": [
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
"*.obj",
"*.o",
"*.a",
"*.lib",
View act-like-an-adult-slack.md

Slack, please for the love of God stop ingesting my gists as snippets.

@kjs3
kjs3 / module-testing.js
Last active Jul 6, 2016
Babel rewire and expect.js testing
View module-testing.js
// my-module.js
function privateFunc () {
console.log("Some convoluted logic.")
return 1 + 2
}
export default function () {
console.log("Hey! I'm the public interface for this module")
@kjs3
kjs3 / US cities by state
Last active Jan 4, 2016
NSDictionary with state keys to NSArrays of NSString cities
View US cities by state
@{
@"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:6401062
Created Aug 31, 2013
fork is making irb unresponsive
View gist:6401062
# This makes irb sluggish and randomly unresponsive
if fork
puts "Hello from parent process #{Process.pid}"
else
puts "Hello from child process #{Process.pid}"
# I thought the child process would exit automatically here?
end
@kjs3
kjs3 / bb_multiple_render_problems.js.coffee
Created Oct 6, 2012
Backbone code that's rendering one of the models 4 extra times.
View bb_multiple_render_problems.js.coffee
# config file
window.App =
Models: {}
Collections: {}
Routers: {}
Views: {}
init: ->
@service_providers = new App.Collections.ServiceProvidersCollection()
@service_providers.fetch
You can’t perform that action at this time.