Skip to content

Instantly share code, notes, and snippets.

@sessa
sessa / app.coffee
Created February 5, 2014 14:50 — forked from aseemk/app.coffee
bunyan = require 'bunyan'
restify = require 'restify'
requireDir = require 'require-dir'
middleware = requireDir './middleware'
routes = requireDir './routes'
settings = require './settings'
app = restify.createServer
name: 'Foo Bar API'
// preserve Twitter's style of JSON string encoding...
// escape higher value unicode (lowercase hex)
// escape < and > (uppercase hex)
// escape / in strings (\/)
// hugs! https://gist.github.com/1306986
// http://stackoverflow.com/questions/4901133/json-and-escaping-characters
function escapedStringify(s, emit_unicode) {
var json = JSON.stringify(s);
return emit_unicode ? json : json.replace(/\//g,
function(c) {
@sessa
sessa / app.js
Created March 3, 2014 22:52 — forked from mdellanoce/app.js
var express = require('express'),
requirejs = require('requirejs'),
app = module.exports = express.createServer();
app.configure('development', function(){
// Use development version of static files
app.use(express.static(__dirname + '/public'));
});
app.configure('production', function(){
75825 http://www.youtube.com/watch?feature=player_profilepage&v=3wbvpOIIBQA
75615 http://www.youtube.com/watch?v=f2JuxM-snGc
75311 https://www.youtube.com/watch?v=G33DdYQZbas
75279 http://www.youtube.com/v/isWyYDxFS8w?color2=FBE9EC&amp
75071 https://www.youtube.com/watch?v=TYytErqGdC4
75003 https://www.youtube.com/watch?v=TYytErqGdC4
74789 http://www.youtube.com/watch?v=nRckgn36lzY
74427 https://www.youtube.com/watch?feature=player_embedded&v=bhhpz9pKyj8
74313 http://www.youtube.com/watch?v=1MwWZEZox2w
74099 http://www.youtube.com/watch?v=7SSXLIZkM3E
@sessa
sessa / image-search.js
Created April 29, 2014 17:01
moar objects
Object
.keys(this._sources)
.map(function(source) {
return this._sources[source].resultColumn;
}.bind(this))
.forEach(function(column) {
var colHeight = column.getHeight();
if (scrollBottom + this._loadMoreOffset > colHeight) {
console.log('LOAD MORE');
<script type='text/javascript' src='http://public.tableausoftware.com/javascripts/api/viz_v1.js'></script><div class='tableauPlaceholder' style='width: 514px; height: 1094px;'><noscript><a href='http:&#47;&#47;www.cnbc.com&#47;id&#47;100869938'><img alt='Deficient Bridges in the U.S. ' src='http:&#47;&#47;public.tableausoftware.com&#47;static&#47;images&#47;KM&#47;KM5GBH3Z4&#47;1_rss.png' style='border: none' /></a></noscript><object class='tableauViz' width='514' height='1094' style='display:none;'><param name='host_url' value='http%3A%2F%2Fpublic.tableausoftware.com%2F' /> <param name='path' value='shared&#47;KM5GBH3Z4' /> <param name='toolbar' value='yes' /><param name='static_image' value='http:&#47;&#47;public.tableausoftware.com&#47;static&#47;images&#47;KM&#47;KM5GBH3Z4&#47;1.png' /> <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' /><param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' /><param name='display_count' value='yes
<style type="text/css">
iframe {
width: 500px;
height: 100%;
margin: 0 auto;
display block;
border: 1px solid #ccc;
}
</style>
@sessa
sessa / gazotem.tmTheme
Created November 16, 2011 20:42
gazotem textmate/sublime text 2 syntax highlighting
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>William D. Neumann</string>
<key>name</key>
<string>gazotem</string>
<key>settings</key>
<array>
@sessa
sessa / LICENSE.txt
Created February 21, 2012 19:40 — forked from aemkei/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@sessa
sessa / ExternalWmodeTransparency.js
Created April 11, 2012 22:42
Waits for flash file to load then applies wmode=transparency param - this is for externally embedded flash objects where you do not have access to the parameters.
jQuery(document).ready(function() {
function addWmodeTransparent() {
var intervalID;
intervalID = setInterval(checkObject, 500);
function checkObject()
{
if($('object').length){
$('object').append('<param name="wmode" value="transparent">');
clearInterval(intervalID);