Skip to content

Instantly share code, notes, and snippets.

View melvynhills's full-sized avatar

Melvyn Hills melvynhills

View GitHub Profile
@maccman
maccman / config.rb
Created August 28, 2011 12:15
Rails 3 Config
# Rails 3 Config
#
# In: config/application.yml
#
# development:
# github:
# key: test
# secret: verysecret-dev
# production:
# github:
@javan
javan / gist:1168475
Created August 24, 2011 16:32
Fix iPhone home button
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/
1.) Open any application
2.) Press and hold the power button until the slide to shutdown swipe bar appears.
3.) Release Power button
4.) Press and hold Home button Lightly
until screen returns to icon screen
class Singleton
@get: -> @instance ?= new @
class Test extends Singleton
constructor: -> alert "Test constructed"
run: -> alert "Test run"
class OtherTest extends Singleton
constructor: -> alert "OtherTest constructed"
run: -> alert "OtherTest run"
# These are my notes from the PragProg book on CoffeeScript of things that either
# aren't in the main CS language reference or I didn't pick them up there. I wrote
# them down before I forgot, and put it here for others but mainly as a reference for
# myself.
# assign arguments in constructor to properties of the same name:
class Thingie
constructor: (@name, @url) ->
# is the same as:
// Records a local webcam feed and converts the recording to SWF.
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.display.Loader;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Rectangle;
import flash.media.Camera;
import flash.media.Video;
@mattmccray
mattmccray / render.js
Created November 1, 2010 19:44
Based on ICanHaz, this supports both Mustache.js and Handlebars.js
// Based on ICanHaz (http://github.com/andyet/ICanHaz.js/blob/master/ICanHaz.js)
// This version supports Mustache and Handlebars
// By M@ McCray
;var render = (function($, engine){
var cache = {},
methods = {};
$(function(){
$('script[type="text/html"]').each(function () {
var name = $(this).attr('id'),
@waynehoover
waynehoover / layout.haml
Created October 20, 2010 01:34
Sinatra S3 Direct Upload application
!!! 5
%html
%head
%title Sinatra AWS Upload Example
%link{:rel => "stylesheet", :href => "/css/swfupload.css", :type => "text/css", :media => "all"}
%link{:rel => "stylesheet", :href => "http://cachedcommons.org/cache/blueprint/0.9.1/stylesheets/screen-min.css", :type => "text/css", :media =>"all"}
%script{:src => "http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"}
%body
= yield