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
serverRootUri = "http://127.0.0.1:8000" | |
mochaPhantomJsTestRunner = serverRootUri + "/browser/test/index.html" | |
module.exports = (grunt) -> | |
grunt.initConfig | |
pkg: grunt.file.readJSON("package.json") | |
coffeelint: | |
gruntfile: | |
src: '<%= watch.gruntfile.files %>' |
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
React = require 'react/addons' | |
TestUtils = React.addons.TestUtils | |
# Component | |
Comp = React.createClass( | |
handleSubmit: (e)-> | |
@props.handleSubmit() | |
handleInputChange: (e)-> |
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
charMap: | |
'á': normal: 'a', regexp: new RegExp('[á]', 'gi') | |
'é': normal: 'e', regexp: new RegExp('[é]', 'gi') | |
'í': normal: 'i', regexp: new RegExp('[í]', 'gi') | |
'ó': normal: 'o', regexp: new RegExp('[ó]', 'gi') | |
'ú': normal: 'u', regexp: new RegExp('[ú]', 'gi') | |
'Á': normal: 'A', regexp: new RegExp('[Á]', 'gi') | |
'É': normal: 'E', regexp: new RegExp('[É]', 'gi') | |
'Í': normal: 'I', regexp: new RegExp('[Í]', 'gi') | |
'Ó': normal: 'O', regexp: new RegExp('[Ó]', 'gi') |
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
# Monkeypatching BSON::Object | |
module BSON | |
class ObjectId | |
# These aliases override default JSON representation of an ObjectId | |
# Spits a string id '540f51de6d61632c74020000', instead of | |
# { "$oid": '540f51de6d61632c74020000' } | |
alias :to_json :to_s | |
alias :as_json :to_s | |
end | |
end |
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
React = require 'React' | |
R = React.DOM | |
ColorPicker = React.createClass( | |
render: -> | |
R.a | |
className: "pla-color-picker collapsed" | |
href: "##{@props.colorPaletteId}" |
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
let env = { | |
'+': (...args)=> args.reduce((mem, cur)=> mem + cur), | |
'*': (...args)=> args.reduce((mem, cur)=> mem * cur), | |
'-': (...args)=> args.reduce((mem, cur)=> mem - cur), | |
'/': (...args)=> args.reduce((mem, cur)=> mem / cur), | |
}; | |
function tokenize(expr) { | |
return expr.replace(/\(|\)/g, ' $& ').trim().split(/\s+/); |
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; (itp "Fooo #{x} #{bar}") | |
; (str "Foooo" x " " bar) | |
(require '[clojure.string :as str]) | |
(defn make-result | |
[re string] | |
(let |
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 _hash(key, size) { | |
key = key.toString(); | |
var hash = 5381; | |
for(var i in key){ | |
var c = key[i]; | |
hash = ((hash << 5) + hash) + c.charCodeAt(0); /* hash * 33 + c */ | |
} | |
return hash % size; | |
} |
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
''' | |
Created on Mar 17, 2013 | |
@author: JuanTejada | |
''' | |
from math import sqrt | |
from operator import div | |
import Image | |
import random | |
import sys |
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
/* | |
Nice things about this approach: | |
- No need to expose $refs to users. Just use regular IDs instead. | |
- No need for double-composition (just compose React components, not queries). | |
- Composition becomes less magical (since we're passing regular IDs around). | |
- Collapse Query and Fragment concepts into Query. | |
- Take advantage of existing template strings to pass in query variables. |
OlderNewer