Skip to content

Instantly share code, notes, and snippets.

View jxson's full-sized avatar

Jason Campbell jxson

View GitHub Profile
/* iphone... */
@media screen and (max-device-width: 480px) {
}
/* ...iphone */
/* iphone portrait... */
@media screen and (max-device-width: 480px) and (orientation:portrait) {
}
/* ...iphone portrait */
/**
* The history class is in charge of the browser
* history and URL's.
*/
TT.history = {};
/** */
TT.history.TABLE_OF_CONTENTS = 'table-of-things';
TT.history.HOME = 'home';
TT.history.FOREWORD = 'foreword';
# 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
@jxson
jxson / using-yepnope-with-less.js
Created April 26, 2011 01:46
Using yepnope.js with less.js
// See:
//
// - http://yepnopejs.com/
// - http://lesscss.org/
yepnope({
test: false,
nope: [
'preload!stylesheets/test.less',
],
callback: {
@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.
@jxson
jxson / jquery.tap.js
Created June 14, 2011 21:46
An example implementation on $('selector').tap();
(function($) {
// DON'T EVER USE AN ALERT INSIDE THE CALLBACK.
$.fn.tap = function(callback) {
if (!this) return false;
return this.each(function() {
var element = this;
if (element.touchHandler) { return; }
@jxson
jxson / nodeunit_test_stub.js
Created September 8, 2011 18:39
nodeunit test stub that allows you to run the file directly with node
// Copy this file into the appropriate test directory with an appropriate
// filename and remove/ edit the tests defined below. Once you do that you can
// run the tests directly using:
//
// node test/my_whatever_test.js
//
// neat.
//
// - checkout https://github.com/caolan/nodeunit
var testCase = require('nodeunit').testCase;
@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 / 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 / git-prompt.sh
Created September 21, 2011 18:52
Git info in your `bash` prompt like ~/Code/haiku (trusting) ☠
export COLOR_NONE='\[\e[0m\]' # No Color
export COLOR_LIGHT_PURPLE='\[\e[1;35m\]'
# Get the name of the branch we are on
git_prompt_info() {
branch_prompt=$(__git_ps1)
if [ -n "$branch_prompt" ]; then
status_icon=$(git_status)
echo $branch_prompt $status_icon
fi