Skip to content

Instantly share code, notes, and snippets.

@talos
talos / stack_level.rb
Created March 11, 2011 03:13
Bypass the DataMapper's infinite loop bug, described at http://datamapper.lighthouseapp.com/projects/20609/tickets/1431-stack-level-too-deep-when-collecting-relations , by converting a collection to an array before iterating over its members' associations
require 'rubygems'
dm_version = "=1.0.2"
gem "dm-core", dm_version
require 'dm-core'
gem "dm-migrations", dm_version
require 'dm-migrations'
@talos
talos / translucent-footer.css
Created October 27, 2011 22:27
Sticky translucent footer
@talos
talos / Gmail Encryption Test
Created November 7, 2011 23:51
Add encryption to gmail using a bookmarklet (you must be in "compose"). Either copy/paste into a bookmark, or copy/paste directly into address bar while in Gmail's "Compose" mode. Works in Safari and Chrome, although you have to use the bookmarks manage
javascript:(function()%7B%22use%20strict%22%3Bvar%20a%3D%7Bcipher%3A%7B%7D%2Chash%3A%7B%7D%2Cmode%3A%7B%7D%2Cmisc%3A%7B%7D%2Ccodec%3A%7B%7D%2Cexception%3A%7Bcorrupt%3Afunction(a)%7Bthis.toString%3Dfunction()%7Breturn%22CORRUPT%3A%20%22%2Bthis.message%7D%2Cthis.message%3Da%7D%2Cinvalid%3Afunction(a)%7Bthis.toString%3Dfunction()%7Breturn%22INVALID%3A%20%22%2Bthis.message%7D%2Cthis.message%3Da%7D%2Cbug%3Afunction(a)%7Bthis.toString%3Dfunction()%7Breturn%22BUG%3A%20%22%2Bthis.message%7D%2Cthis.message%3Da%7D%7D%7D%3Ba.cipher.aes%3Dfunction(b)%7Bthis.h%5B0%5D%5B0%5D%5B0%5D%7C%7Cthis.w()%3Bvar%20c%2Cd%2Ce%2Cf%2Cg%3Dthis.h%5B0%5D%5B4%5D%2Ch%3Dthis.h%5B1%5D%3Bc%3Db.length%3Bvar%20i%3D1%3Bif(c!%3D%3D4%26%26c!%3D%3D6%26%26c!%3D%3D8)throw%20new%20a.exception.invalid(%22invalid%20aes%20key%20size%22)%3Bthis.a%3D%5Be%3Db.slice(0)%2Cf%3D%5B%5D%5D%3Bfor(b%3Dc%3Bb%3C4*c%2B28%3Bb%2B%2B)%7Bd%3De%5Bb-1%5D%3Bif(b%25c%3D%3D%3D0%7C%7Cc%3D%3D%3D8%26%26b%25c%3D%3D%3D4)d%3Dg%5Bd%3E%3E%3E24%5D%3C%3C24%5Eg%5Bd%3E%3E16%26255%5D%3C%3C16%
@talos
talos / jquery-svgpan-nested.html
Created March 7, 2012 13:10
jquery-svgpan nested SVGs
<html><head>
<!-- jQuery -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="http://talos.github.com/jquery-svgpan/jquery-svgpan.js"></script>
<title>jquery-svgpan Nested SVGs</title>
<style type="text/css">
body {
font-family: Helvetica, sans-serif;
@talos
talos / get_nouns.py
Created March 7, 2012 16:16 — forked from jordanorelli/get_nouns.py
get all svgs from the noun project, draw them all asynchronously with pan & zoom
from os import path
import re
import requests
url_template = "http://thenounproject.com/download/zipped/svg_%d.zip"
base_dir = path.dirname(path.abspath(__file__))
svg_dir = path.join(base_dir, 'svg')
pattern = re.compile(r'<svg.*/svg>', re.DOTALL)
for x in xrange(1, 300):
@talos
talos / foobar
Created July 4, 2012 16:53
my very special thing
blah blah blahedeblah comments
diff --git a/r.js b/r.js
index 846a2d9..24962f9 100644
--- a/r.js
+++ b/r.js
@@ -3142,7 +3142,7 @@ define('node/print', ['fs'], function (fs) {
'use strict';
function print(msg) {
fs.writeSync(process.stdout.fd, msg + '\n');
- fs.fsyncSync(process.stdout.fd);
+ //fs.fsyncSync(process.stdout.fd);
@talos
talos / .tmux.conf
Last active August 29, 2015 14:08 — forked from snuggs/.tmux.conf
##############################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
#############################
############################################################################
@talos
talos / gist:b356ca82db8935c2ed1c
Created February 8, 2015 17:56
acris doc tiffs
http://a836-acris.nyc.gov/DS/DocumentSearch/GetImage?doc_id=2009101300174001&page=1
@talos
talos / output.csv
Created February 17, 2015 14:39
5+ airbnb unit buildings in nyc
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 6 columns, instead of 4 in line 9.
COUNT(*),host_id,street,avg(latitude),avg(longitude),neighbourhood_cleansed
28,1329986,"Covert Street, Brooklyn, NY 11207, United States",40.6897709856896,-73.9099505334989,Bushwick
25,20780082,"45th Street, Brooklyn, NY 11220, United States",40.6408982219979,-74.0054280464033,"Sunset Park"
21,417504,"Box St, Brooklyn, NY 11222, United States",40.7375268363829,-73.9533337391861,Greenpoint
13,577199,"A Patchen Avenue, Brooklyn, NY 11221, United States",40.688390328439,-73.9269561652776,Bedford-Stuyvesant
12,469713,"Taaffe Place, Brooklyn, NY 11205, United States",40.6914523965438,-73.9593211900759,"Clinton Hill"
11,5219616,"A Jefferson Avenue, Brooklyn, NY 11221, United States",40.6852469923265,-73.9289235404313,Bedford-Stuyvesant
11,6885157,"Jefferson Avenue, Brooklyn, NY 11216, United States",40.6830812633974,-73.9507476222691,Bedford-Stuyvesant
10,2156913,"30th Ave, Astoria , NY 11103, United States",40.7649092318874,-73.9176678069283,Astoria
10,3968794,"60th Street, Brooklyn, NY 11219, United States",40.63