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 fetch = function (url) { | |
| return new Promise(function (resolve, reject) { | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open('GET', url); | |
| xhr.onload = function() { | |
| if (xhr.status === 200) { | |
| resolve(xhr); |
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
| " Make Vim more useful | |
| set nocompatible | |
| " Use the OS clipboard by default (on versions compiled with `+clipboard`) | |
| set clipboard=unnamed | |
| " Enhance command-line completion | |
| set wildmenu | |
| " Allow cursor keys in insert mode | |
| set esckeys | |
| " Allow backspace in insert mode | |
| set backspace=indent,eol,start |
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
| server { | |
| listen 80; | |
| server_name example.com; | |
| location / { | |
| proxy_pass http://127.0.0.1:3000; | |
| } | |
| location ~ ^/(images/|scripts/|styles/|robots.txt|humans.txt|favicon.ico) { | |
| root /your/app/public/folder; |
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 DB { | |
| constructor (name) { | |
| this.name = name; | |
| this.collections = {}; | |
| this.async = function (callback, timeout) { | |
| return new Promise((resolve, reject) => { | |
| if (!callback) { return reject('Error!'); } |
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 EndPoint = function (baseUrl) { | |
| var request = function (type, url) { | |
| return new Promise(function (resolve, reject) { | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open(type, url); | |
| xhr.setRequestHeader('Content-Type', 'application/json'); | |
| xhr.responseType = 'json'; |
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
| module.exports = { | |
| watch: true, | |
| entry: [ | |
| __dirname + '/src/app' | |
| ], | |
| module: { | |
| loaders: [ | |
| { test: /\.js$/, exclude: /node_modules/, loaders: ['6to5-loader?optional=coreAliasing'] } | |
| ] |
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
| import React from 'react'; | |
| import most from 'most'; | |
| let push = ({source: {sink}}, event) => { | |
| try { | |
| sink.event(event.type, event); | |
| } catch (err) { | |
| sink.error(event.type, err); | |
| } |
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
| import React from 'react'; | |
| import AppActions from './actions'; | |
| import ItemsStore from './items-store'; | |
| let List = React.createClass({ | |
| componentDidMount() { | |
| ItemsStore.addChangeListener(this.forceUpdate.bind(this)); | |
| }, |
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
| let obj = { | |
| a: new Set([1,2,3]), | |
| b: new Set([4,2,6,7]), | |
| c: new Set([6,2,1,0]) | |
| }; | |
| Object.defineProperties(obj, { | |
| all: { |