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 MyPromise { | |
constructor(cb) { | |
this.value; | |
this.state; | |
this.fulfilledCB = []; | |
this.rejecteddCB = []; | |
cb(this.resolve, this.reject); | |
} | |
then = (successCB, failureCB) => { |
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 http = require('http'); | |
var server = http.createServer(function(req, res) { | |
// console.log(req); // debug dump the request | |
// If they pass in a basic auth credential it'll be in a header called "Authorization" (note NodeJS lowercases the names of headers in its request object) | |
var auth = req.headers['authorization']; // auth is in base64(username:password) so we need to decode the base64 | |
console.log("Authorization Header is: ", auth); |
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 React from 'react'; | |
import { Formik } from 'formik'; | |
import history from '../../../history'; | |
import ProgressBar from './ProgressBar'; | |
class Wizard extends React.Component { | |
static Page = ({ children, parentState }) => { | |
return children(parentState); | |
}; |
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
clone = x => [...x] | |
push = y => x => [...x, y] | |
pop = x => x.slice(0, -1) | |
unshift = y => x => [y, ...x] | |
shift = x => x.slice(1) | |
sort = f => x => [...x].sort(f) | |
delete = i => x => [...x.slice(0, i), ...x.slide(i+1)] | |
splice = (s, c, ...y) => x => [...x.slice(0,s), ...y, ...x.slice(s+c)] |
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 React, { Component } from 'react'; | |
import '../styles/SingleItemEdit.css'; | |
import Paper from 'material-ui/Paper'; | |
import FlatButton from 'material-ui/FlatButton'; | |
import TextField from 'material-ui/TextField'; | |
const defaultContent = { | |
name: '', | |
description: '', |
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
<div class="container"> | |
<div class="title">Calculator</div> | |
<div class="input-box"> | |
<div class="ans"></div> | |
<div class="input"></div> | |
</div> | |
<div class="button-box"> | |
<div class="row"> | |
<button value="ac">AC</button> | |
<button value="ce">CE</button> |