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 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 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 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 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 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: { |
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 compose = function() { | |
var funcs = arguments; | |
return function() { | |
var args = arguments; | |
for (var i = funcs.length; i --> 0;) { | |
args = [funcs[i].apply(this, args)]; | |
} | |
return args[0]; | |
}; | |
}; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <winsock2.h> | |
#pragma comment(lib,"ws2_32.lib") | |
#define PORTNUM 1738 | |
#define BUFMAX 1024 |
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 MyModule from 'my-module'; // module to test | |
let test = 'test'; // mock data | |
let testMsg = 'Should return message: ' + test; // test message | |
MyModule({ test }, data => { | |
if (data.res !== test) { | |
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
get :: String -> IO String | |
get url = getResponseBody =<< simpleHTTP (getRequest url) | |
get :: String -> IO String | |
get url = getResponseBody =<< simpleHTTP $ getRequest url | |
get :: String -> IO String | |
get url = getResponseBody . simpleHTTP $ getRequest url |