This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript | |
function touchHandler(event) | |
{ | |
var touches = event.changedTouches, | |
first = touches[0], | |
type = ""; | |
switch(event.type) | |
{ | |
case "touchstart": type = "mousedown"; break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div.foo-section h2, div.bar-section h2 { height: 20px; padding-left: 30px; background-position: left top; } | |
div.foo-section h2.my { background-image: url("images/my.png"); } | |
div.foo-section h2.very { background-image: url("images/very.png"); } | |
div.foo-section h2.excellent { background-image: url("images/excellent.png"); } | |
div.foo-section h2.mother { background-image: url("images/mother.png"); } | |
div.foo-section h2.just { background-image: url("images/just.png"); } | |
div.foo-section h2.sent { background-image: url("images/sent.png"); } | |
div.foo-section h2.us { background-image: url("images/us.png"); } | |
div.foo-section h2.nine { background-image: url("images/nine.png"); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
choices = [ | |
{ name: 'rock', beats: ['scissors', 'lizard'] } | |
{ name: 'paper', beats: ['rock', 'spock'] } | |
{ name: 'scissors', beats: ['paper', 'lizard'] } | |
{ name: 'lizard', beats: ['paper', 'spock'] } | |
{ name: 'spock', beats: ['rock', 'scissors'] } | |
] | |
tbody = $('tbody') | |
thead = $('thead') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// generated using `sass-convert normalize.css` | |
/*! normalize.css 2011-08-12T17:28 UTC · http://github.com/necolas/normalize.css | |
/* ============================================================================= | |
* HTML5 display definitions | |
* ========================================================================== | |
/* | |
* Corrects block display not defined in IE6/7/8/9 & FF3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
## Partials | |
Included in templates using CoffeeScript's string interpolation: | |
partial = "<partial>content {{ foo }}</partial>" | |
template = """ | |
<template> | |
<stuff>#{ partial }</stuff> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This fabric file makes setting up and deploying a django application much | |
easier, but it does make a few assumptions. Namely that you're using Git, | |
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have | |
Django installed on your local machine and SSH installed on both the local | |
machine and any servers you want to deploy to. | |
_note that I've used the name project_name throughout this example. Replace | |
this with whatever your project is called._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def yellow(*args): | |
some_string = ' '.join([str(arg) for arg in args]) | |
return '\033[93m%s\033[0m' % (some_string,) | |
def green(*args): | |
some_string = ' '.join([str(arg) for arg in args]) | |
return '\033[92m%s\033[0m' % (some_string,) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
# Dump your data from Posterous. | |
Requires: | |
* Posterous username and password | |
* An API Token from http://posterous.com/api | |
* Posterous site id also from http://posterous.com/api | |
* The Python libraries requests and python-dateutil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<style> | |
div.image, div.image1x { | |
width: 1024px; | |
height: 768px; | |
background: url(image_1x.jpg) no-repeat; | |
-webkit-background-size: cover; | |
} |
OlderNewer