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 Module = Stapes.subclass(); | |
var mod = new Module(); | |
function initRender() { | |
// MyApp would be some Reacy component you've defined | |
React.renderComponent(<MyApp mod={mod} />, node); | |
} | |
// ready is a custom event to trigger initRender | |
// from the Module contructor |
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
// on proper key press | |
chrome.runtime.onMessage.addListener(function(request, sender) { | |
if (!request.tabIndex) { return; } | |
var tabIndex = request.tabIndex; | |
chrome.tabs.query({currentWindow: true, index: tabIndex}, function(tab) { | |
if (!tab.length) { return; } | |
chrome.tabs.update(tab[0].id, {active: true}); |
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
/** | |
* Dispatcher | |
* | |
* Requires: <script src="http://d3js.org/queue.v1.min.js"></script> | |
*/ | |
var Dispatcher = function() { | |
this._q = queue(1); | |
this._events = {}; | |
this._E = function(message) { | |
this.message = message; |
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 | |
# encoding: utf-8 | |
""" | |
generate_keys.py | |
Generate CSRF and Session keys, output to secret_keys.py file | |
Usage: | |
generate_keys.py [-f] |
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 width = 460, | |
height = 300, | |
radius = Math.min(width, height) / 2, | |
twoPi = 2 * Math.PI, | |
progress = 0, | |
formatPercent = d3.format(".0%"); | |
var arc = d3.svg.arc() | |
.startAngle(0) |
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
document = require 'global/document' | |
nextTick = require 'next-tick' | |
HashRouter = require 'hash-router' | |
Event = require 'geval' | |
cuid = require 'cuid' | |
extend = require 'xtend' | |
hg = require 'mercury' | |
h = hg.h |
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
/** @jsx m */ | |
'use strict'; | |
var R = require('ramda'); | |
var m = require('mithril'); | |
var autocompleter = function() { | |
var autocompleter = {}; |
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 atom = {"things": []}; | |
function Thing() { | |
this.isNew = true; | |
} | |
function thingView(thing) { | |
var cls = ['thing']; | |
cls.push(thing.isNew ? 'new' : 'notNew'); | |
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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var deku = require('deku'); | |
var dom = deku.element; | |
var render = deku.render; | |
var tree = deku.tree; | |
var App = { |
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
function AutoCompltr(wrapper, suggestions, inputProps, cb, oninput) { | |
this.wrapperNode = wrapper; | |
this.suggestionsList = []; | |
this.suggestionNodes = []; | |
this.pointer = -1; | |
this.callback = cb; | |
this.suggestionsNode = document.createElement('ul'); | |
this.inputNode = document.createElement('input'); | |
if (suggestions && suggestions.length) { |
OlderNewer