Skip to content

Instantly share code, notes, and snippets.


Christoph Nakazawa cpojer

View GitHub Profile
View gist:d011b030ec880f0df881
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"
View rm-merge.js
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 =>
flatten( =>
p.type == 'ObjectExpression'
View App.js
import relayNestedRoutes from 'relay-nested-routes';
const NestedRootContainer = relayNestedRoutes(React, Relay);
<Router history={new BrowserHistory()}>
<Route component={NestedRootContainer}>
name="home" // added a name to the route
View matchRoute.js
function matchRoute<T>(
route: {name: string},
map: {[key: string]: () => T}
): ?T {
return map[] ? map[]() : null;
// Usage
matchRoute(this.props.route, {
'ProfileRoute': () => <Profile {...props} />,
View RootContainer.js
route={{name, params, queries}}
View main-panel.html
<!doctype html>
<style type="text/css">
body {
margin: 0;
iframe {
bottom: 0;
View UserAgent.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="ua.js" type="text/javascript"></script>
View gist:361474
* Use the Slick Selector Engine with MooTools Core 1.2.4 by @cpojer
* Tested with Slick branch "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
View gist:440783
# Configuration File for JavaScript Lint 0.2.6
# Developed by Matthias Miller (
# 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.
#### Feel free to experiment with enabling/disabling individual warnings to
View Toy.js
JavaScript Implementation of the TOY CPU which we used in the
lecture RECHNERNETZE UND -ORGANISATION (Computer Networks and Organization)
More Information:
Instruction Set:
This implementation comes with a built-in boot loader.
It expects files in the following format:
line 1: CAFE
You can’t perform that action at this time.