Skip to content

Instantly share code, notes, and snippets.

View heliostatic's full-sized avatar

Ben Lee-Cohen heliostatic

View GitHub Profile
@heliostatic
heliostatic / gist:3001755
Created June 27, 2012 05:47 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@heliostatic
heliostatic / main.rb
Created October 26, 2011 18:04 — forked from daz4126/main.rb
Short, Long and Pretty Urls - Using Sinatra & DataMapper to demonstrate different types of urls
require 'sinatra'
require 'data_mapper'
require 'slim'
require 'digest/sha1'
DataMapper.setup(:default, ENV['DATABASE_URL'] || File.join("sqlite3://",settings.root, "development.db"))
class Note
include DataMapper::Resource
property :id, Serial
@heliostatic
heliostatic / README.md
Created May 19, 2011 16:03 — forked from bergie/README.md
Falsy Values tutorials
@heliostatic
heliostatic / show
Created April 20, 2011 19:45 — forked from tekacs/show
# Usage: show <local-port> <subdomain>
function show() {
DOMAIN=".tekacs.com"
REMOTE="$2$DOMAIN"
ssh -tR 1080:127.0.0.1:$1 vps "sudo ssh -Nl \$USER -L $REMOTE:80:127.0.0.1:1080 localhost"
}
// Provides a device_scale class on iOS devices for scaling user
// interface elements relative to the current zoom factor.
//
// http://37signals.com/svn/posts/2407-device-scale-user-interface-elements-in-ios-mobile-safari
// Copyright (c) 2010 37signals.
// Slightly optimized by Mathias Bynens <http://mathiasbynens.be/>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
# Copy paste this file in your terminal
# The following will create a dir which contains the rails repo.
# You can start edit this later on. It will also create a Gemfile and a Vagrantfile.
# It will run bundle and it will # download and activate the virtualbox that contains
# everything you need to start # testing.
mkdir rails_test_box
cd rails_test_box
git clone git://github.com/rails/rails.git
bonsai
rdiscount
#!/usr/bin/ruby
#
# I deliberately didn't DRY /usr/local references into a variable as this
# script will not "just work" if you change the destination directory. However
# please feel free to fork it and make that possible.
#
# If you do fork, please ensure you add a comment here that explains what the
# changes are intended to do and how well you tested them.
#
# 14th March 2010:
@heliostatic
heliostatic / example_note_keeping_app.rb
Created March 16, 2010 04:40 — forked from pietern/example_note_keeping_app.rb
fork of an example note taking app
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#