Skip to content

Instantly share code, notes, and snippets.

View mrandyclark's full-sized avatar

Andrew Clark mrandyclark

View GitHub Profile
@mrandyclark
mrandyclark / index.html
Created June 8, 2010 12:39
Easy jQuery Tabs
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Simple Tabs</title>
@mrandyclark
mrandyclark / 20100220004952_create_posts.rb
Created February 27, 2010 20:20
Rails Polymorphic Association migrations and models, check "console.rb" to see end result
# posts migration
# posts are the parent, have many types
class CreatePosts < ActiveRecord::Migration
def self.up
create_table :posts do |t|
t.integer :user_id
t.references :content, :polymorphic => true
t.timestamps
end
@mrandyclark
mrandyclark / gist:310530
Created February 21, 2010 20:48
Grabs a JSON version of your twitter feed and displays it.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Tweets</title>
<script type="text/javascript" language="javascript" src="jquery-1.4.1.min.js"></script>
<script>