Skip to content

Instantly share code, notes, and snippets.

@onedesign
onedesign / jquery.ba-tinypubsub.js
Created June 16, 2012 13:25 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
<table width="600" bgcolor="#ffffff">
<tr>
<td width="480" height="48" rowspan="3"><img src="images/logo.gif" alt="Special Markets Insurance Company" border="0"></td>
<td width="100" height="17" colspan="5"></td>
</tr>
<tr>
<td width="39" height="24"></td>
<td width="25" height="24"><a href="https://www.facebook.com/SMIC2615"><img src="images/social-facebook.gif" alt="Facebook" border="0" /></a></td>
<td width="10"></td>
@onedesign
onedesign / mongodb-upstart.sh
Created January 4, 2011 21:29
Ubuntu upstart script for MongoDB with automatic repair
# Ubuntu upstart file at /etc/init/mongodb.conf
pre-start script
mkdir -p /var/lib/mongodb/
mkdir -p /var/log/mongodb/
end script
start on runlevel [2345]
stop on runlevel [06]
$("#add_to_team").live("click", function() {
var player_href = $(this).attr('href')
var player_slug = player_href.substring(player_href.search(/[a-z]+-[a-z]+$/));
$.post('/fantasy_team_players', {id: player_slug}, function(data) {
success: $("#add_to_team").html("added to your team")
}, "json");
return false;
});
# system_controller.rb
class Admin::SystemController < Admin::AdminController
def edit
@system = System.find(params[:id])
end
end
# system_controller_test.rb
v = Vimeo::Advanced::Video.new("api_key", "secret_key")
response = v.get_list_by_tag("dog")
# returns:
# {
# "rsp"=> {
# "videos" => {
# "perpage"=>"25", "on_this_page"=>"25", "page"=>"1",
# "video"=>
# [{"title"=>"Arduino Web Controlled Dog Waterer", "id"=>"4620716", "owner"=>"76289", "privacy"=>"anybody", "is_hd"=>"1"},