Skip to content

Instantly share code, notes, and snippets.

View jxson's full-sized avatar

Jason Campbell jxson

View GitHub Profile
@jxson
jxson / 0_reuse_code.js
Created June 6, 2014 00:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jxson
jxson / README.md
Created August 24, 2012 06:44 — forked from adammw/README.md
Node.js for Raspberry Pi

Node.js for Raspberry Pi

This is a work in progress - it may not work!

Pre-built binaries

Raspbian (hard-float)

v0.8.6-pre (adammw/node@3a42578d477249cc8851cd76cfb4fa4cb88ab0a0)

@jxson
jxson / hack.sh
Created April 6, 2012 18:38 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@jxson
jxson / gist:1840807
Created February 16, 2012 01:41 — forked from mikeal/gist:1840641
get a new/clean port with node.js
var portrange = 45032
function getPort (cb) {
var port = portrange
portrange += 1
var server = net.createServer()
server.listen(port, function (err) {
server.once('close', function () {
cb(port)
@jxson
jxson / HTML language
Created November 22, 2011 19:01 — forked from kornelski/HTML language
TextMate HTML language tweaked to support unqoted attributes
{ scopeName = 'text.html.basic';
firstLineMatch = '<!DOCTYPE|<(?i:html)|<\?(?i:php)';
fileTypes = ( 'html', 'htm', 'shtml', 'xhtml', 'phtml', 'php', 'inc', 'tmpl', 'tpl', 'ctp' );
foldingStartMarker = '(?x)
(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl)\b.*?>
|<!--(?!.*--\s*>)
|^<!--\ \#tminclude\ (?>.*?-->)$
|<\?(?:php)?.*\b(if|for(each)?|while)\b.+:
|\{\{?(if|foreach|capture|literal|foreach|php|section|strip)
|\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
@jxson
jxson / .gitignore
Created October 1, 2011 23:23 — forked from weaver/.gitignore
Express + Formidable, works with bodyParser and sets req.body correctly.
node_modules
@jxson
jxson / gist:1224553
Created September 18, 2011 01:09 — forked from graybill/gist:1144159
# we should be running psql in dev since heroku does.
default: &DEFAULT
adapter: postgresql
encoding: utf8
min_messages: warning
development:
<<: *DEFAULT
database: tedx_dev
test:
<<: *DEFAULT
@jxson
jxson / forceScrollbars.coffee
Created September 13, 2011 23:40 — forked from madrobby/forceScrollbars.coffee
Get Safari (Lion) to hopefully always indicate & show scrollbars correctly
# CoffeeScript source
$.fn.forceScrollbars = ->
@css position: 'static'
@[0].offsetHeight if @length > 0
@css position: 'relative'
@jxson
jxson / bitly-node.md
Created May 9, 2011 20:38 — forked from joemccann/bitly-node.md
Bitly shortening from the command line with node, motherfuckers.
# Add this to more_web_steps.rb
# Selenium docs: http://code.google.com/p/selenium/wiki/RubyBindings#Javascript_Alert/Confirm today!
When /^I (accept|dismiss) the "([^"]*)" alert$/ do |action, text|
alert = page.driver.browser.switch_to.alert
alert.text.should eq(text)
alert.send(action)
end