Skip to content

Instantly share code, notes, and snippets.

@alecperkins
alecperkins / templates.coffee
Created October 21, 2011 15:40
Backbone template…template
###
## Partials
Included in templates using CoffeeScript's string interpolation:
partial = "<partial>content {{ foo }}</partial>"
template = """
<template>
<stuff>#{ partial }</stuff>
@alecperkins
alecperkins / gist:1364430
Created November 14, 2011 16:56
Simulated ForeignKeys from MongoEngine Document to Django Models
# Using the `@property` decorator allows the MongoEngine Document object to have
# properties that reference Models, and be got/set like normal foreign keys.
# This same pattern can work the other way and allow Models interface with
# Documents.
class Foo(mongoengine.Document):
# The `id` of the property is stored in the Document.
user_id = mongoengine.IntField()
# Setters and getters to interface with the SQL DB and set Users to the
@eleclerc
eleclerc / Solarized (Dark).tmTheme
Created February 25, 2012 00:38
Solarized theme (dark & light) with markdown support for Sublime Text 2 editor
<?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>name</key>
<string>Solarized (dark)</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@alecperkins
alecperkins / namedview.coffee
Created August 8, 2012 21:12
NamedView: Backbone View with automatic className
# Public: A Backbone View that automagically adds CSS classes based on its
# CoffeeScript class names, going right up the inheritence chain. This
# is cool because it's less crap to write, and plays well with CSS.
#
# Given:
#
# class Person extends NamedView
# class Wizard extends Person
# harry = new Wizard()
#
@cmod
cmod / minmal_twitter.css
Created September 13, 2012 18:45 — forked from maxfenton/gist:3670929
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 {
@domenic
domenic / promises.md
Last active June 24, 2024 03:11
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@ulope
ulope / interpolation.scss
Created October 15, 2012 14:14 — forked from idan/interpolation.scss
Works with this changes
$colors: rgb(202,0,32), rgb(244,165,130), rgb(247,247,247), rgb(146,197,222), rgb(5,113,176);
@mixin choropleth($bucket) {
.RdBu .q#{$bucket}-5 {
$base-fill: nth($colors, $bucket);
fill: $base-fill;
&:hover {
fill: darken($base-fill, 10%);
}
}
@dfm
dfm / LICENSE
Last active September 9, 2023 23:56
XKCD-style plots in d3
Copyright (c) 2012–2013 Daniel Foreman-Mackey
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@sippey
sippey / Louis-ck-email.md
Created November 3, 2012 22:40
Louis CK email

Hello. Its louis here. I'm clacking this to you on my phone in my dressing room here at studio 8H, right in 30 rockefeller center, in Manhattan, new york city, new york, america, world, current snapshot of all existence everywhere.

Tonight I'm hosting Saturday Night Live, something I zero ever in my life saw happening to me. And yet here it is completely most probably happening (I mean, ANYTHING could NOT happen. So we'll see).

I've been working here all week with the cast, crew, producers and writers of SNL, and with Lorne Michaels. Such a great and talented group of people.

And here we are in the middle of New York City, which was just slammed by a hurricane, leaving behind so much trouble, so much difficulty and trauma, which everyone here is still dealing with every day.

Last night we shot some pre-tape segments in greenwich Village, which was pitch black dark for blocks and blocks, as it has been for a week now.