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
const {2: serializedGlob = "['**']", 3: command} = process.argv; | |
console.log(serializedGlob, command) |
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
const {promisify} = require('util'); | |
const exec = promisify(require('child_process').exec); | |
exec('git diff --name-only origin/master').then(({stdout}) => console.log(stdout)) |
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
var url = 'https://ronreiter-meme-generator.p.mashape.com/meme?meme=Baby+Godfather&font_size=50&font=Impact&top=Thanks+m&bottom=Later'; | |
var headers = new Headers({'X-Mashape-Key': 'API_KEY'}); | |
var options = { | |
method: 'GET', | |
headers: headers, | |
mode: 'cors', | |
cache: 'default' | |
}; | |
var request = new Request(url); |
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 runWhen from 'run-when'; | |
runWhen([ | |
{ | |
glob: ['app/components/index.js', 'app/__tests__/**'], | |
task(paths) { | |
console.log('This will be called!'); | |
} | |
}, | |
{ |
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
class ImgDimensions extends React.Component { | |
state = {width: 0, height: 0, errored: false}; | |
constructor() { | |
this.onLoad = this.onLoad.bind(this); | |
this.onError = this.onError.bind(this); | |
} | |
onLoad({target: {height, width}}) { | |
this.setState({width, height}); |
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
// FROM: | |
class Foo { | |
constructor() { | |
this.bar = this.bar.bind(this); | |
} | |
bar() { | |
return 1; | |
} | |
} |
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
const Benchmark = require('benchmark'); | |
const loadModule = require('./loader'); | |
const {fiboJs, fiboJsRec, fiboJsMemo} = require('./fibo.js'); | |
const suite = new Benchmark.Suite; | |
const numToFibo = 40; | |
window.Benchmark = Benchmark; //Benchmark.js uses the global object internally | |
console.info('Benchmark started'); |
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
int fibonacci(int n) { | |
int a = 1; | |
int b = 1; | |
while (n-- > 1) { | |
int t = a; | |
a = b; | |
b += t; | |
} |
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 fiboJs(num){ | |
var a = 1, b = 0, temp; | |
while (num >= 0){ | |
temp = a; | |
a = a + b; | |
b = temp; | |
num--; | |
} |
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 = (filename) => { | |
return fetch(filename) | |
.then(response => response.arrayBuffer()) | |
.then(buffer => WebAssembly.compile(buffer)) | |
.then(module => { | |
const imports = { | |
env: { | |
memoryBase: 0, | |
tableBase: 0, | |
memory: new WebAssembly.Memory({ |