Skip to content

Instantly share code, notes, and snippets.

View scottymac's full-sized avatar

Scott McMillin scottymac

View GitHub Profile
test 1
Forking trevor's gist
### /lib/rack/sass ###
require 'sass'
module Rack
class Sass < Rack::File
def initialize(root, options = {})
@root = root
@options = options
end
# Lighter -- Campfire from the command line
# usage: ruby lighter.rb subdomain "Main Room" macournoyer@gmail
require "rubygems"
require "tinder"
require "readline"
require "highline/import"
class Lighter
def initialize(room)
@room = room
@scottymac
scottymac / base58.rb
Created June 18, 2009 18:52 — forked from jou/base58.rb
# http://www.flickr.com/groups/api/discuss/72157616713786392/
# manufacturing flic.kr style photo URLs
module Base58
def self.encode(n)
alphabet = %w(
1 2 3 4 5 6 7 8 9
a b c d e f g h i
j k m n o p q r s
t u v w x y z A B
#forked to fix error in the original
require 'rubygems'
require 'sinatra'
helpers do
def subdomains(tld_len=1) # we set tld_len to 1, use 2 for co.uk or similar
@subdomains ||= if (request.host.nil? ||
/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.match(request.host))
[]
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@scottymac
scottymac / gist:1384347
Created November 21, 2011 23:34 — forked from shripadk/gist:552554
Setting up Heroku Hostname SSL with GoDaddy SSL Cert
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing).
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here:
* Heroku Hostname SSL
* GoDaddy Standard SSL Certificate
* Zerigo DNS
@scottymac
scottymac / gist:1761921
Created February 7, 2012 21:01 — forked from trevorturk/gist:1756760
Bare minimum html5 template
<!DOCTYPE html>
<html>
<head>
<title>title</title>
</head>
<body>
</body>
</html>
@scottymac
scottymac / gist:1810536
Created February 12, 2012 20:01
Custom validators for jQuery Tools
// custom validators
// generic validator for required input fields to work with validator() & [placeholder]
$.tools.validator.fn("input[required]", "Please complete this mandatory field.", function(input, value) {
var pass;
if ((value == "") || (value == $(input).attr("placeholder"))) {
$(input).addClass("invalid");
pass = false;
} else {
$(input).removeClass("invalid");