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
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} />, |
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
<RelayRootContainer | |
Component={Component} | |
route={{name, params, queries}} | |
/> |
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
<!doctype html> | |
<html> | |
<head> | |
<style type="text/css"> | |
body { | |
margin: 0; | |
} | |
iframe { | |
bottom: 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>UserAgent</title> | |
<script src="ua.js" type="text/javascript"></script> |
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
/* | |
* Use the Slick Selector Engine with MooTools Core 1.2.4 by @cpojer | |
* | |
* Tested with Slick branch "develop": | |
* http://github.com/mootools/slick/tree/develop | |
* | |
* How to use: | |
* - Download Slick from github and include Slick.Parser.js and Slick.Finder.js | |
* - Remove Selectors.js | |
* - Optionally you can remove all the methods mentioned below from your mootools-core build |
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
# | |
# Configuration File for JavaScript Lint 0.2.6 | |
# Developed by Matthias Miller (http://www.JavaScriptLint.com) | |
# | |
# This configuration file can be used to lint a collection of scripts, or to enable | |
# or disable warnings for scripts that are linted via the command line. | |
# | |
#### NOTE TO TEXTMATE BUNDLE USERS: | |
#### Feel free to experiment with enabling/disabling individual warnings to |
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
/* | |
JavaScript Implementation of the TOY CPU which we used in the | |
lecture RECHNERNETZE UND -ORGANISATION (Computer Networks and Organization) | |
More Information: http://www.cs.princeton.edu/introcs/52toy/ | |
Instruction Set: http://www.cs.princeton.edu/introcs/53isa/ | |
This implementation comes with a built-in boot loader. | |
It expects files in the following format: | |
line 1: CAFE |
OlderNewer