Skip to content

Instantly share code, notes, and snippets.

require 'erb'
class GawkerBingo
def initialize
@bingo_items = []
File.open('gawkerbingo.txt', 'r').each do |line|
@bingo_items << line.chomp
end
require 'rubygems'
require 'yajl/json_gem'
module AP
# a = AP::ParseData.new('/file.txt')
class ParseData
def initialize(file)
@file = file
@ap_scratch = []
@final_results = []
@macdiva
macdiva / Christmas Polka Dots
Created December 15, 2010 07:18
Christmas Polka Dots
/*
Christmas Polka Dots
By Chrys Wu, December 2010
info[at]chryswu[dot]com
Licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
http://creativecommons.org/licenses/by-nc-sa/3.0/
//*/
void setup () {
size(960,600);
# a messy hack written by Edd Dumbill. http://twitter.com/edd
# You may need to rerun this script if you hit a Twitter Error because you
# use up API rate limiting. That's why we pickle the results, so we can resume
# where we left off.
# get the twitter module using 'easy_install twitter'
from twitter.api import Twitter, TwitterError
from twitter.oauth import OAuth
#!/usr/bin/python
import json, sys, re
filename = sys.argv[1]
f = open(filename, 'r')
contents = json.load(f)
contentIndex = {}
for content in contents['content']:
> write.csv(count.data, file = 'count_data.csv', row.names = FALSE)
Error in inherits(x, "data.frame") : object 'count.data' not found
class Grid
constructor: (@width, @height) ->
@grid = []
get: (x,y) ->
@grid[y*@width + x]
set: (x,y,val) ->
@macdiva
macdiva / google-map-marker-with-shadow.js
Created May 20, 2012 04:33 — forked from simonw/google-map-marker-with-shadow.js
google-map-marker-with-shadow.js
/* Here's how to add a coloured marker to a Google Map with a shadow in the
right place.
The pin itself is dynamically generated using the Google Charts API,
documented here:
https://developers.google.com/chart/image/docs/gallery/dynamic_icons
Note however that this API was marked as deprecated on April 20th 2012
although it's not clear when or if it will be turned off.
*/
@macdiva
macdiva / counter.rb
Created June 1, 2012 06:00 — forked from luigi/counter.rb
Calculate the percentage of tweets linking to a website that came from the Tweet button
#
# Before running:
# $ gem install twitter
#
# To run:
# $ ruby counter.rb sleazywebsite.com
#
# Context:
# http://luigimontanez.com/2012/actually-social-media-buttons-work-really-well
#
@macdiva
macdiva / minmal_twitter.css
Created October 20, 2012 01:06 — forked from cmod/minmal_twitter.css
Twitter stylebot
/* -------------------------------------------------
MINIMAL TWITTER FOR FLUID / USERSTYLES
Special thanks to:
Max Fenton (@maxfenton) for kicking this off
------------------------------------------------- */
.trends, .bird-topbar-etched, .wtf-module, .site-footer, .topics {