This file contains hidden or 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 app, server, | |
proxy = require('express-http-proxy') | |
express = require('express'), | |
path = require('path'), | |
host = process.env.HOST || '127.0.0.1', | |
port = process.env.PORT || 3333, | |
root = path.resolve(__dirname, './src'); | |
app = express(); | |
app.use(function(req, res, next) { console.log(req.url); next(); }); |
This file contains hidden or 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 | |
projectName=$1 | |
folderPath="/code/tmp/${projectName}" | |
if [[ ! $projectName ]]; then | |
echo "You need to specify a project name" | |
exit 1 | |
fi | |
if [ -d "${folderPath}" ]; then |
This file contains hidden or 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 1 ==== | |
function Person(componentName) { | |
this.componentName = componentName | |
} | |
// talk will end up being in __proto__ | |
Person.prototype.talk = function () { | |
console.log(this.name) | |
} | |
const john = new Person('div1') |
This file contains hidden or 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
curlData=' | |
{ | |
"set": { | |
"uuid": "59097720-9676-11e8-bccf-5dc6be09647d", | |
"name": "Test Set", | |
"cards": [ | |
{ | |
"question": "Test question 1", | |
"answer": "Test answer 1", | |
"isMarkdown": true, |
This file contains hidden or 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> | |
<link href='http://fonts.googleapis.com/css?family=Lato:900' rel='stylesheet' type='text/css'> | |
<style type="text/css"> | |
.pulse-button { | |
margin: 100px; | |
background: #FFFFFF; |
This file contains hidden or 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 promisePipe(promises, argsToFirstPromise) { | |
return promises.reduce((prev, promise) => { | |
return prev.then(x => promise(x)) | |
}, Promise.resolve(argsToFirstPromise)) | |
} | |
// use promise pipe | |
promisePipe([ | |
add1, |