Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
require 'rubygems'
require 'eventmachine'
module ChatServer
def post_init
(@@connections ||= []) << self
@username = "Guest" + rand(123123123).to_s
msg = "-- #{@username} has connected\n"
<!-- BEGIN RIGHT COLUMN -->
<div id="rightColumn">
<h2 id="upcomingEvents1">
<a href="javascript:" class="carousel-jumper" rel="slide-1">Events</a>
<a href="javascript:" class="carousel-jumper" rel="slide-2" id="setLikes">Likes</a>
<a href="javascript:" class="carousel-jumper" rel="slide-3">Tags</a>
</h2>
<div id="carousel-wrapper">
<div id="carousel-content">
/* GET and Display Live event info based on set data.
----------------------------------------------------------*/
function listEvents()
{
var arts = "";
json.each(function(s) {
arts = arts + "artists[]=" + s.track.artist.name.gsub(/(feat.*)/,'').gsub(/(vs.*)/,'').strip().gsub('&','%26').gsub(' ','%20')+"&";
});
new Ajax.Request("/browse/events/get?set="+set_id+"&uri="+escape(arts), {
method:'get',
function fb_publish_stream(target, attach, links, message, message_prompt, callback, auto_publish, actor_id)
{
FB.Connect.streamPublish(message, attach, links, target, message_prompt, callback, auto_publish);
}
function share_set()
{
var attach = {
create_table "friendships", :force => true do |t|
t.integer "user_id"
t.integer "friend_id"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "friendships", ["friend_id"], :name => "index_friendships_on_friend_id"
add_index "friendships", ["user_id"], :name => "index_friendships_on_user_id"
desc "Scrape WMC"
task(:scrape_wmc => :environment) do
require 'hpricot'
require 'chronic'
geocoder = Geocode.geocoder
doc = Hpricot(open("http://wintermusicconference.com/thelist/index.php"))
headers = (doc/"#thelistevents div.eht")
event_bodies = (doc/"#thelistevents td.eventbody")
@dodeja
dodeja / Dev Show 24
Created September 20, 2010 06:52 — forked from jseifer/Dev Show 24
http://antirez.com/post/autocomplete-with-redis.html
http://praegnanz.de/html5video/
http://briancray.com/2010/09/08/html5-microdata/
http://diveintohtml5.org/extensibility.html
http://www.quirksmode.org/blog/archives/2010/09/testing_blackbe.html
http://intridea.com/2010/9/13/a-web-developer-goes-native-with-android
http://nvie.com/posts/how-i-boosted-my-vim/
http://onebuttonmouse.com/ramblings/domainbrain-2-0-is-now-available/
http://www.tuttoaster.com/ruby-for-php-developers/
http://blog.brandonbloom.name/2010/09/how-two-pythonistas-accidentally-fell.html
@dodeja
dodeja / gist:664577
Created November 5, 2010 18:34
mobile_app.jsp
<body>
<div id="loader">
<div id="loader_inner">
<div class="spinner">
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
<div class="bar4"></div>
<div class="bar5"></div>
<div class="bar6"></div>
@dodeja
dodeja / Gemfile
Created May 7, 2011 22:45
Rails 3.1 Beta 1 on Heroku Working Config
# source 'http://rubygems.org'
source :gemcutter
gem 'rails', '3.1.0.beta1'
# Asset template engines
gem 'json'
gem 'sass'
gem 'coffee-script'
gem 'uglifier'
Strobeo.Views.PhotoView = Backbone.View.extend({
tagName: "li",
className: "pitm_wrap",
events: {
"click a" : "show_photo"
},
initialize: function() {
this.template = Strobeo.get_tmpl('photos', 'photo_item');
this.model.view = this;
_.bindAll(this, 'render');