Skip to content

Instantly share code, notes, and snippets.

$.getJSON("http://chipchirp.heroku.com/chirps.json?callback=?&user_id[]=1",
function(data){
for(i=0;i<2;i++)
console.log(data[i].chirp.content);
});
@evanrmurphy
evanrmurphy / gist:750448
Created December 21, 2010 19:40
Simple HTML/jQuery snippet to query the chirps feed using JSONP
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>
$(function(){
$.getJSON(
"http://chipchirp.heroku.com/chirps.json?callback=?",
function(data) {
console.log(data);
@evanrmurphy
evanrmurphy / gist:735729
Created December 10, 2010 03:40
Access the Chip Chirp API with JSONP
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>
$(function(){
$.getJSON("http://chipchirp.heroku.com/chirps/?callback=?",
function(data) {
console.log(data);
});
(function () {
alert("hello world!");
}();
(def foo ()
(prn "hello world!"))
@evanrmurphy
evanrmurphy / firsttime.arc
Created December 6, 2010 05:01
One of akkartik's favorite macros (see http://arclanguage.org/item?id=12889)
(mac firsttime(place . body)
`(unless ,place
,@body
(set ,place)))
class Followship < ActiveRecord::Base
attr_accessible :followed_id
belongs_to :follower, :class_name => "User"
belongs_to :followed, :class_name => "User"
validates :follower_id, :presence => true
validates :followed_id, :presence => true
end
# == Schema Information
# Schema version: 20101109221104
#
# Table name: users
#
# id :integer not null, primary key
# first_name :string(255)
# last_name :string(255)
# email :string(255)
# poker_site :string(255)