Skip to content

Instantly share code, notes, and snippets.

View neonstalwart's full-sized avatar

Ben Hockey neonstalwart

  • google.com
  • Boulder, CO
View GitHub Profile
@neonstalwart
neonstalwart / config
Last active December 15, 2015 10:29
my nginx *.dev config - the first line in each file is the full path to the file because gists don't give enough context. see https://gist.github.com/neonstalwart/5246908 for some extra config for virtualbox (not included here because it's ugly)
# /usr/local/etc/nginx/common
index index.html index.htm index.json;
if_modified_since before;
location ~ /\.(svn|git|ht) {
deny all;
}
# /etc/pf.conf
scrub-anchor "com.apple/*"
nat-anchor "com.apple/*"
nat on { en0 en1 } from 192.168.56.0/24 to any -> { (en0) (en1) }
rdr-anchor "com.apple/*"
dummynet-anchor "com.apple/*"
anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple"
@neonstalwart
neonstalwart / define.sublime-snippet
Last active December 17, 2015 08:38
a couple of useful dojo ST2 snippets
<snippet>
<content><![CDATA[
define([
${1:'dojo/_base/declare'}
], function (${2:declare}) {
return declare(${3});
});
]]></content>
@neonstalwart
neonstalwart / findFirst.js
Last active December 17, 2015 11:19
use SimpleQueryEngine to find the first match in an array
define([
'dojo/_base/array',
'dojo/store/util/SimpleQueryEngine'
], function (array, SimpleQueryEngine) {
return function findFirst(arr, query) {
var matches = SimpleQueryEngine(query).matches,
found;
array.some(arr, function (it) {
@neonstalwart
neonstalwart / local-selenium.md
Last active July 31, 2024 20:57
how to run intern self tests with a local selenium
$ brew install selenium-server-standalone chromedriver
$ git clone [email protected]:theintern/intern.git
$ cd intern
$ npm install --production
$ ln -s .. node_modules/intern
$ curl https://gist.github.com/neonstalwart/6630466/raw/f0e4e4efbefa40c746f7c68e2bb4fa0dd5215047/selftest.local.intern.js > tests/selftest.local.intern.js
$ java -jar /usr/local/opt/selenium-server-standalone/selenium-server-standalone-2.35.0.jar -p 4444 &
$ node node_modules/intern/runner.js config=tests/selftest.local.intern
@neonstalwart
neonstalwart / index.js
Created May 30, 2014 17:47
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
@neonstalwart
neonstalwart / index.js
Created May 30, 2014 17:47
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
@neonstalwart
neonstalwart / index.js
Created May 30, 2014 17:47
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
@neonstalwart
neonstalwart / index.js
Created May 30, 2014 17:47
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
@neonstalwart
neonstalwart / index.js
Created May 30, 2014 17:51
requirebin sketch
var mercury = require("mercury")
var h = mercury.h
var state = mercury.hash({})
function render(state) {
return h("ul", [
h('li', h('a', { href: '#foo' }, 'link without array')),
h('li', [ h('a', { href: '#bar' }, 'link with array') ])
])