Skip to content

Instantly share code, notes, and snippets.

Mason Fischer masonforest

Block or report user

Report or block masonforest

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:838236
class PaymentsController < ApplicationController
def show
@payment = Payment.find(params[:id])
@response = Remit::PipelineResponse.new(
request.fullpath,
params,
remit
)
View gist:1006561
require 'sinatra'
require 'google_oauth'
client = GoogleOAuth::Client.new(
:client_id => 'XXXX',
:client_secret => 'XXXX',
:redirect => 'http://localhost:4567/oauth2callback',
)
get '/' do
redirect client.authorize_url
View gist:1052024
STIRLTECH@stirling-technologiess-macbook ~
$ ping stirltech.com
PING stirltech.com (184.106.170.207): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
^C
--- stirltech.com ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
STIRLTECH@stirling-technologiess-macbook ~
$ ssh masonf@masonforest.com
View gist:1052044
$ traceroute www.masonforest.com
traceroute to www.masonforest.com (184.106.179.10), 64 hops max, 40 byte packets
1 192.168.1.1 (192.168.1.1) 168.354 ms 1.276 ms 1.323 ms
2 * * *
3 ge-7-19-ur01.woburn.ma.boston.comcast.net (68.85.184.145) 9.225 ms 9.088 ms 15.147 ms
4 be-60-ar01.woburn.ma.boston.comcast.net (68.87.145.173) 9.598 ms 9.987 ms 14.630 ms
5 pos-0-0-0-0-ar01.needham.ma.boston.comcast.net (68.85.162.141) 16.265 ms 10.893 ms 14.248 ms
6 pos-2-5-0-0-cr01.newyork.ny.ibone.comcast.net (68.86.90.65) 46.430 ms 45.682 ms 49.340 ms
7 xe-11-0-0.edge1.newyork2.level3.net (4.71.186.1) 46.948 ms 46.465 ms 127.906 ms
8 vlan52.ebr2.newyork2.level3.net (4.69.138.254) 53.155 ms 55.335 ms 46.822 ms
View gist:1218245
class SitesController < ApplicationController
before_filter :authenticate_user, :except => "show"
def new
@site = Site.new
@site.domain = Domain.new
end
def activate
@site = Site.find(params[:id])
flash[:message] = render_to_string :partial=>"sites/welcome_message"
redirect_to sites_path
View gist:1218253
class Site < ActiveRecord::Base
after_create :create_heroku_domain,:create_bucket,:create_dropbox_folder
belongs_to :user
has_one :domain
has_one :bucket
has_many :pages
accepts_nested_attributes_for :domain, :allow_destroy => true
validates_uniqueness_of :path, :scope => :user_id
def self.find_by_domain(domain)
@masonforest
masonforest / dabblet.css
Created Jan 29, 2012
The first commented line is your dabblet’s title
View dabblet.css
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, blue);
min-height:100%;
duration(2s)
@masonforest
masonforest / API V1.js
Created Mar 18, 2012
Yelp API Pizza in Cambridge v1 vs v2
View API V1.js
{
"message": {
"text": "OK",
"code": 0,
"version": "1.1.1"
},
"items": [{
"nm": "Angelo's Pizza",
"img": "",
"rating": 4.5,
@masonforest
masonforest / gist:2208408
Created Mar 26, 2012
Library Last Update API Example
View gist:2208408
$ curl "localhost:3000/api/discs/last_update.json?auth_token=U4gdadgu2jFpdfG5Bhue"
"2012-03-26T15:09:18Z"%
@masonforest
masonforest / gist:2208472
Created Mar 26, 2012
Demo API Call: Discs
View gist:2208472
curl "localhost:3000/api/discs.json?auth_token=U4gdadgu2jFpdfG5Bhue"
[{
"disc": {
"id": 485,
"tracks": [{
"id": 276,
"title": "implement 24/365 initiatives"
}],
"album": {
You can’t perform that action at this time.