Skip to content

Instantly share code, notes, and snippets.

View how-to-embed-a-tilt-cont.html
<iframe style="height:360px; width:180px; border:0" src="https://www.tilt.com/tilts/phi-delts-fall-festival-long-sleeve-tshirt/iframe_widget"></iframe>
View embed-a-tilt.html
<iframe style="height:360px; width:180px; border:0" src="your_tilt_link_goes_here/iframe_widget"></iframe>
View sunnies-embed.html
<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-version="4" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:8px;"> <div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:50% 0; text-align:center; width:100%;"> <div style=" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAAGFBMVEUiIiI9PT0eHh4gIB4hIBkcHBwcHBwcHBydr+JQAAAACHRSTlMABA4YHyQsM5jtaMwAAADfSURBVDjL7ZVBEgMhCAQBAf//42xcNbpAqakcM0ftUmFAAIBE81IqBJdS3lS6zs3bIpB9WED3YYXFPmHRfT8sgyrCP1x8uEUxLMzNWElFOYCV6mHWWwMzdPEKHlhLw7NWJqkHc4uIZphavDzA2JPzUDsBZziNae2S6owH8xPmX8G7zzgKEOPUoYHvGz1TBCxMkd3kwNVbU0gKHkx+iZILf77IofhrY1nYFnB/lQPb79drWOyJVa/DAvg9B/rLB4cC+Nqgdz/TvBbBnr6GBReqn/nRmDgaQEej7WhonozjF+Y2I/fZou/qAAAAAElFTkSuQmCC); display:block; height:44px; margin:0 auto -44px; position:relati
@kent
kent / the_new_hello_world.c
Created Feb 27, 2013
Let's change the "Hello World" to "Change the World" because let's face it, that's what we are doing.
View the_new_hello_world.c
#include<stdio.h>
main()
{
printf("Change the World");
}
View gist:4953484
from pymongo import MongoClient
connection = MongoClient('173.255.248.42', 27017)
db = connection.eventish
View gist:4773880
<script>__FILE__="(none)";page_load_globals.times.code_load_completed = new Date().getTime();host.profiler.stopSummary("~ 0 loading framework js");</script>
<!-- DEBUG-TAG: app -->
<script>__FILE__="(none)";host.profiler.startSummary("~ 1 creating server globals");
server_globals=(function() {return Deserializer.create().thaw({"S":"C","C":"Map","D":[["current_version",{"S":"C","C":"VersionInfo","D":{"build_time_ms":1360630883000,"build_date_str":"Tue Feb 12 01:01:23 2013 +0000","commit_id":"712592c0708daab876ef4b893da1dd7b5622f983","commit_date_str":"Mon Feb 11 22:07:28 2013 +0000","release_revision":"20130212_010123_712592c0708daab876ef4b893da1dd7b5622f983","session_version":58}}],["session_id",4047635787510],["request_dispatch_time",1360706683095],["enabled_features",{"S":"C","C":"Array","D":["enable_only_propagate_unknown_loading_values_to_loading_boundaries","enable_memcache","enable_search_indexing","enable_action_coalescing","enable_list_caching","enable_fail_on_reentrant_handlers","enable_mobile_task_r
@kent
kent / git_branch_show
Created Sep 25, 2012
Show Git Branch for a given project
View git_branch_show
# Add this to your ~/.bash_profile to see which local git branch you are on.
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[1;34m\]"
GREEN="\[\033[0;32m\]"
NO_COLOUR="\[\033[0m\]"
View email_sieve.rb
f = File.open("")
content = f.read
r = Regexp.new(/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b/)
emails = content.scan(r).uniq
puts emails
View friendship_redis_mysql_hybrid.rb
class Friend < ActiveRecord::Base
belongs_to :user
belongs_to :contact, :class_name => "User", :foreign_key => "contact_id"
# user befriends contact
def self.befriend(user,contact)
relationship = find_by_user_id_and_contact_id(user.id,friend.id)
if relationship.nil?
transaction do
You can’t perform that action at this time.