Skip to content

Instantly share code, notes, and snippets.

View nicjohnson's full-sized avatar

Nic Johnson nicjohnson

View GitHub Profile
@nicjohnson
nicjohnson / gist:d63c926462817b249e6b
Last active August 29, 2015 14:14
Elevator Saga
{
init: function(elevators, floors) {
var requestedFloors = {};
for (var i = 0; i < floors.length; i++) {
(function (i) {
var floor = floors[i];
floor.on('up_button_pressed', function () {
requestedFloors[i] = true;
@nicjohnson
nicjohnson / app.js
Created September 19, 2014 18:44
express-stormpath example
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var stormpath = require('express-stormpath');
var debug = require('debug')('sp');
var routes = require('./routes/index');
@nicjohnson
nicjohnson / herokuAddUser.sh
Last active December 22, 2015 20:59
Add a collaborator to all Heroku apps available via `heroku apps`
#!/bin/bash
while getopts "a:" opt; do
case $opt in
a)
user=$OPTARG
;;
\?)
echo "Unknown option -$OPTARG"
exit 1;
#!/bin/bash
while getopts "arp:d:" opt; do
case $opt in
a)
adding=true
;;
r)
adding=false
;;
<?php get_header(); ?>
<pre><code><?php print_r($wp_query) ?></code></pre>
<?php if ( have_posts() ) : ?>
<ul class="unstyled stacked">
<?php while ( have_posts() ) : the_post(); ?>
<li><a class="" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
{
"color_scheme": "Packages/Color Scheme - Default/Twilight Nic.tmTheme",
"draw_white_space": "selection",
"font_face": "Inconsolata",
"font_size": 16.0,
"ignored_packages":
[
"Vintage"
],
"indent_to_bracket": true,