This file contains 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
Interfaces | |
========== | |
Jargon... "Persistent points" will be mouse, pen tablets, and other pointing devices that | |
leave a "cursor" even when it's not being used. "Volatile points" are input points in the | |
context of surface based input devices, or others that do not leave a cursor when | |
inactive. (i.e. Wiimotes) Surface input devices may or may not have proximity support, | |
and the event firing model should be different based on that. | |
TODO: The names "persistent" and "volatile" sound pretty bad. Personally would like to change it. |
This file contains 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
/** | |
* Gesture recognizer for compound multi-touch transformations. | |
* | |
* 1. pinch/zoom/scale gesture. | |
* 2. rotate gesture. | |
*/ | |
function TransformRecognizer(element) { | |
// Reference positions for the start of the transformation. | |
this.referencePair = null; |
This file contains 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
What is the variance in pixel sizes across devices? Compute it. | |
Since we have so many devices, pixels don't make sense anymore. Leave it | |
to somebody else. | |
I'd like to just say "this button is 5x5cm" and scale stuff | |
appropriately. CSS pixels suck since they aren't really pixels. Apple | |
guidelines say 44x44px as min size but this is fundamentally about the | |
real size of the display, not pixels. Actually double check iPad vs | |
iPhone. |
This file contains 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
content/posts/.../my-new-post/index.txt | |
My new post | |
=========== | |
posted: 2012-03-01 | |
Just **testing** | |
1. Hello | |
2. World |
This file contains 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
/* | |
* Loads a handlebars.js template at a given URL. Takes an optional name, in which case, | |
* the template is added and is reference-able via templateName. | |
*/ | |
function loadTemplate(url, name, callback) { | |
var contents = $.get(url, function(templateText) { | |
var compiledTemplate = Ember.Handlebars.compile(templateText); | |
if (name) { | |
Ember.TEMPLATES[name] = compiledTemplate | |
} else { |
This file contains 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
/static/sass/: | |
screen.scss: (common stylesheet) | |
phone.scss, tablet.scss, desktop.scss: (form factor-specific styles) | |
/static/js/: | |
libs/: (external libraries - DO NOT MODIFY) | |
ember-and-friends.js | |
jquery.js | |
formfactor.js | |
views/: (form-factor specific views) |
This file contains 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
positionView: function() { | |
console.log('positioning'); | |
// TODO: Fix this nonsense. | |
// Check for the existence of this.element because when the transition | |
// value initially changes, the element doesn't actually exist! | |
if (this.get('element')) { | |
this.get('element').style.webkitTransform = | |
'translate(0, ' + this.get('transition') + 'px)'; | |
} |
This file contains 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
p { | |
font-size: 110%; | |
} |
This file contains 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
#!/usr/bin/env python | |
import boto | |
AWS_ACCESS_KEY_ID = 'foo' | |
AWS_SECRET_ACCESS_KEY = 'bar' | |
bucket_name = 'baz' | |
conn = boto.connect_s3(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) | |
bucket = conn.create_bucket(bucket_name, |
This file contains 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 twisted.internet import reactor | |
from autobahn.websocket import WebSocketServerFactory, WebSocketServerProtocol | |
from threading import Thread | |
class KeySocketProtocol(WebSocketServerProtocol): | |
def __init__(self, factory): | |
self.factory = factory | |
def onOpen(self): | |
self.factory.clients.append(self) |