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
#!/bin/bash | |
DIR=$(cd `dirname $0` && pwd) | |
$DIR/../node_modules/stylus/bin/stylus --use "$DIR/../node_modules/nib/lib/nib.js" --out "$DIR/../CSS" --watch "$DIR/../STYL" |
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
if (!window.addEventListener){ | |
Element.NativeEvents.propertychange = 2; | |
Element.Events.change = { | |
base: function(){ | |
var type = this.type; | |
return (this.get('tag') == 'input' && (type == 'radio' || type == 'checkbox')) ? 'propertychange' : 'change' | |
}, | |
condition: function(event){ | |
return (this.type == 'radio' && !this.checked) ? false : 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
Element.implement('alter', function(properties){ | |
var parsed = Slick.parse(properties).expressions[0][0], | |
attributes = parsed.attributes, | |
classList = parsed.classList, | |
i, attr, value; | |
if (attributes) for (i = 0; i < attributes.length; i++){ | |
attr = attributes[i]; | |
value = 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
# ZSH Theme by @cpojer | |
PROMPT='[%{$fg[red]%}%n%{$fg[black]%}: %{$fg[blue]%}%~%{$reset_color%}\ | |
$(git_prompt_info)\ | |
%{$fg[black]%}%(!.#.]$)%{$reset_color%} ' | |
PROMPT2='' | |
RPS1='' | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%} %{$fg[yellow]%}(" | |
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" |
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
instance.extend("parseImportSpecifiers", function (inner) { | |
return function (node) { | |
node.importKind = "value" | |
if (this.isContextual("type") || this.type === tt._typeof) { | |
if (this.type === tt._typeof) { | |
node.importKind = "typeof" | |
this.eat(tt._typeof) | |
} |
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
module.exports = function(file, api) { | |
var j = api.jscodeshift; // alias the jscodeshift API | |
var root = j(file.source); // parse JS code into an AST | |
// the main update method replaces merge with ObjectExpression | |
const update = path => | |
j(path).replaceWith(j.objectExpression( | |
flatten(path.value.arguments.map(p => | |
p.type == 'ObjectExpression' | |
? p.properties |
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
/** | |
* @providesModule LJPEG | |
*/function c(a){throw a;}var k=void 0,m=!0,s=null,u=!1,v;v||(v=eval("(function() { try { return Module || {} } catch(e) { return {} } })()"));var aa={},w;for(w in v)v.hasOwnProperty(w)&&(aa[w]=v[w]);var ba="object"===typeof process&&"function"===typeof require,ca="object"===typeof window,da="function"===typeof importScripts,ea=!ca&&!ba&&!da; | |
if(ba){v.print=function(a){process.stdout.write(a+"\n")};v.printErr=function(a){process.stderr.write(a+"\n")};var fa=require.call(null, "fs"),ga=require.call(null, "path");v.read=function(a,b){var a=ga.normalize(a),d=fa.readFileSync(a);!d&&a!=ga.resolve(a)&&(a=path.join(__dirname,"..","src",a),d=fa.readFileSync(a));d&&!b&&(d=d.toString());return d};v.readBinary=function(a){return v.read(a,m)};v.load=function(a){ha(read(a))};v.arguments=process.argv.slice(2);module.exports=v}else ea?(v.print=print,"undefined"!=typeof printErr&& | |
(v.printErr=printErr),v.read="undefined"!=typeof read?read:function(){c("no read() available (jsc?)")},v.readBinary=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
import {Router, Route} from 'react-router'; | |
import BrowserHistory from 'react-router/lib/BrowserHistory'; | |
import App from './components/App'; | |
import Widget from './components/Widget'; | |
// A wrapper to create a Relay container | |
function createRelayContainer(Component, props) { | |
if (Relay.isContainer(Component)) { | |
// Construct the RelayQueryConfig from the route and the router props. |
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 relayNestedRoutes from 'relay-nested-routes'; | |
const NestedRootContainer = relayNestedRoutes(React, Relay); | |
React.render( | |
<Router history={new BrowserHistory()}> | |
<Route component={NestedRootContainer}> | |
<Route | |
name="home" // added a name to the route | |
path="/" |
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 matchRoute<T>( | |
route: {name: string}, | |
map: {[key: string]: () => T} | |
): ?T { | |
return map[route.name] ? map[route.name]() : null; | |
} | |
// Usage | |
matchRoute(this.props.route, { | |
'ProfileRoute': () => <Profile {...props} />, |