Skip to content

Instantly share code, notes, and snippets.

View rstrobl's full-sized avatar

Robert Strobl rstrobl

View GitHub Profile
@bsodmike
bsodmike / anonymous_user.rb
Created October 12, 2012 18:26 — forked from zacstewart/anonymous_user.rb
Rails Soft Sign-Up
class AnonymousUser < User
attr_accessible *ACCESSIBLE_ATTRS, :type, :token, as: :registrant
def register(params)
params = params.merge(type: 'User', token: nil)
self.update_attributes(params, as: :registrant)
end
end
@rstrobl
rstrobl / gist:939013
Created April 23, 2011 21:48
Getting YouTube download URLs for a given video ID
// fill in the video ID here
$video_id = '';
$info_url = 'http://www.youtube.com/get_video_info?video_id=' . $video_id;
$info_page = file_get_contents($info_url);
// put query strings into local scope
parse_str($info_page);
// parse fmt_stream_map
@eckardt
eckardt / NonLocalReturn.js
Last active August 21, 2022 18:14
implementation of squeak's non-local returns and translation example of squeak to javascript
// original code from http://michaelspeer.knome.net/2010/05/pattern-for-non-local-returns-in.html
var WithNonLocalReturn = function( block ){
var nonLocalReturnException = function(){
var value = null;
this.setReturnValue = function( retVal ){ value = retVal };
this.getReturnValue = function( retVal ){ return value };
}
var nonLocalReturnEx = new nonLocalReturnException();
@shripadk
shripadk / gist:552554
Created August 27, 2010 00:59
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