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
// DocumentCloud workspace hotkeys. To tell if a key is currently being pressed, | |
// just ask: `dc.app.hotkeys.control` | |
dc.app.hotkeys = { | |
KEYS: { | |
'16': 'shift', | |
'17': 'control', | |
'91': 'command', | |
'93': 'command', | |
'224': 'command' |
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
import simplejson | |
from django.contrib.sessions.backends.base import SessionBase, CreateError | |
from django_ext.redis_helper import get_redis | |
class SessionStore(SessionBase): | |
""" | |
A Redis-based session store. |
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
// Main controller for the journalist workspace. Orchestrates subviews. | |
dc.controllers.Workspace = Backbone.Controller.extend({ | |
routes : { | |
'help/:page': 'help', | |
'help': 'help' | |
}, | |
// Initializes the workspace, binding it to <body>. | |
initialize : function() { |
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
// Provide top-level namespaces for our javascript. | |
(function() { | |
window.dc = {}; | |
dc.controllers = {}; | |
dc.model = {}; | |
dc.app = {}; | |
dc.ui = {}; | |
})(); |
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
// Load the TCP Library | |
net = require('net'); | |
// Keep track of the chat clients | |
var clients = []; | |
// Start a TCP Server | |
net.createServer(function (socket) { | |
// Identify this client |
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
import base64 | |
import os | |
from tastypie.fields import FileField | |
from django.core.files.uploadedfile import SimpleUploadedFile | |
class Base64FileField(FileField): | |
""" | |
A django-tastypie field for handling file-uploads through raw post data. | |
It uses base64 for en-/decoding the contents of the file. | |
Usage: |
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
. | |
|____.DS_Store | |
|____admin | |
| |____accounts.js | |
| |____admin.js | |
|____app | |
| |____downloader.js | |
| |____editor.js | |
| |____hotkeys.js | |
| |____preferences.js |
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
// BEFORE | |
// http://jsfiddle.net/markcoleman/ffBcU/11/ | |
var currentColor = "white"; | |
var hold = false; | |
$(".canvas") | |
.delegate(".pixel", "mouseover", function() { | |
$(this).css("background-color", currentColor); | |
}) |
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
[url "https://github.com/"] | |
insteadOf = "gh:" |
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
var express = require('express'); | |
var app = express.createServer(); | |
app.configure(function () { | |
app.use(app.router); | |
}); | |
app.set('views', __dirname + '/views'); | |
app.set('view engine', 'html'); | |
app.register('.html', require('eco')); |
OlderNewer