Skip to content

Instantly share code, notes, and snippets.

View windmaomao's full-sized avatar

Fang Jin windmaomao

  • Raleigh, NC
View GitHub Profile
// Usage
<Router>
<Provider store={store}>
<ListeningRouter>
<Main />
</ListeningRouter>
</Provider>
</Router>
@keif
keif / breadth-first-search.js
Created April 29, 2016 04:46
JavaScript based Breadth-First Search
/* A Queue object for queue-like functionality over JavaScript arrays. */
var Queue = function() {
this.items = [];
};
Queue.prototype.enqueue = function(obj) {
console.log("enqueue: ", obj);
this.items.push(obj);
};
Queue.prototype.dequeue = function() {
return this.items.shift();
@adisuryadi
adisuryadi / compile.sh
Last active November 28, 2021 00:16
Run ES6/ES2016/ES2017 in Coderunner (using babel)
#!/bin/bash
#
# This script will transplie our code using babel and evaluates it using node.js
#
# Steps:
# 1) Install babel globally:
# npm install -g babel-cli
# or
# yarn global add babel-cli
# 2) Create a new language in Coderunner preferences (eg. Javascript (Babel)).