Skip to content

Instantly share code, notes, and snippets.

View willbailey's full-sized avatar

Will Bailey willbailey

  • Facebook
  • San Francisco, CA
View GitHub Profile
#!/usr/bin/env ruby
require 'rubygems'
require 'json'
require 'cgi'
require 'time'
# =====================================================
# = Proof of Concept Shareflow Command Line Interface =
# =====================================================
# currently it just gets the list of your 10 most recent
(function() {
// Class for template value placeholder objects
var _Value = Class.create({
toString: function() {
// "x==null" is true for catches null and undefined
return this.value == null ? '' : this.value.toString();
}
});
/**
# Renders all the JST and returns the Javascript TemplateCache
class TemplateCache
def generate(opts={})
defaults = {:noisy => false}
options = defaults.merge(opts)
jst_files, templates, errors = [],[],[]
view_path = Rails::Configuration.new.view_path
view = ActionView::Base.new(view_path)
# This script will verify the privacy settings on documents you have loaded
# to the scribd api.
require 'rubygems'
require 'hpricot'
require 'open-uri'
def get_docs(api_uri, limit, offset)
api_uri += "&limit=#{limit}&offset=#{offset}"
@willbailey
willbailey / gist:230246
Created November 9, 2009 20:15
Audit Scribd API Usage
# This script will verify the privacy settings on documents you have loaded
# to the scribd api.
require 'rubygems'
require 'hpricot'
require 'open-uri'
def get_docs(api_uri, limit, offset)
api_uri += "&limit=#{limit}&offset=#{offset}"
#! /usr/bin/env ruby
# ==================================
# = SOLUTION TO RUBY QUIZ NUMBER 2 =
# ==================================
# by Will & Stef
require 'optparse'
# map of positions to characters for each number
//= require "util"
// This code is MIT licensed: http://creativecommons.org/licenses/MIT/
// Zenbe Inc (2009).
// Ensure our Zenbe namespaces exist.
window.zen = window.zen || {};
window.zen.util = window.zen.util || {};
/**
* The DropManager class provides a pleasant API for observing HTML5 drag-n-drop
#include <Client.h>
#include <Ethernet.h>
#include <Server.h>
#include <TinyXML.h>
#include <WString.h>
byte mac[] = { 0xAC, 0xCC, 0xAC, 0xBB, 0xAA, 0xAB };
byte ip[] = { 10, 0, 1, 109 };
byte gateway[] = { 10, 0, 1, 1 };
byte subnet[] = { 255, 255, 255, 0 };
require 'rubygems'
require 'flareshow'
Flareshow::Service.configure('<domain>')
Flareshow::Service.authenticate('<your username>','<your password>')
flow=Flow.first
flow.create_post(:content => "Hello World")
#import "SFFlow.h"
@implementation SFFlow
// Custom logic goes here.
#pragma mark common managed object methods
+ (id *)upsert:(NSDictionary *)data
{
NSEntityDescription *entityDescription = [[self class] entityInManagedObjectContext:[[self class] _moc]];