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
const asyncFun = fun => (...args) => { | |
const gen = fun(...args); | |
return drain(gen); | |
} | |
function ensurePromise(maybePromise) { | |
return maybePromise.then | |
? maybePromise | |
: Promise.resolve(maybePromise); |
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
const useThumbnailRail = (items, slideChange, active, width) => { | |
const [springs, api] = useSprings(items.length, i => ({ | |
x: i * getWindowWidth(), | |
})) | |
const index = useRef(active) | |
const lastIndex = useRef(active) | |
const correct = useCallback( | |
(i, down) => (result, controller) => { |
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
const cl = (e,a,s=[...new Set(e)],l=s.length,n=(i,v)=>v>=s[i]?n(i-1,v):i)=>a.reduce(([c,i],v,_,__,ni=n(i,v))=>[(c.push(ni+2),c),ni],[[],l-1])[0]; |
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 useReduxReducer(reducer, initialState, initializer, middleware) { | |
const lastState = useRef(initialState) | |
const enhancedReducer = (state, action) => lastState.current = reducer(state, action) | |
const [state, dispatchOriginal] = useReducer( | |
enhancedReducer, | |
initialState, | |
initializer | |
); |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; | |
using System.Threading; | |
using System.Text.RegularExpressions; | |
namespace UNIMotor |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Net.Sockets; | |
using System.Net; | |
using System.IO; | |
using System.Collections; | |
using System.Threading; | |
using System.Threading.Tasks; |
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
const { transformFactory } = require('../utils/stream'); | |
const { GENERATED_AT_TIME } = require('../utils/constants'); | |
module.exports = transformFactory((stream, config, transform) => data => { | |
const transformed = transform(data); | |
const id = transformed[0].subject; | |
const graph = transformed.reduce( | |
(acc, triple) => { | |
acc[triple.predicate] = { '@id': triple.object }; |
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
const sumFibs=(num)=>(fib=((s,l=0,n=1,m=0)=>(n%2?n<=s&&(m+=n)&&0:0)||n>s?m:fib(s,n,l+n,m)))(num); | |
sumFibs(1000); |
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
# Pull base image. | |
FROM ubuntu:14.04 | |
# Install. | |
RUN \ | |
sudo sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \ | |
sudo apt-get update && \ | |
sudo apt-get install -y wget && \ | |
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb && \ | |
sudo apt-get update && \ |
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
#include <iostream> | |
#include <sstream> | |
#include "pvector.h" | |
using namespace std; | |
template <typename T> | |
inline pair<T, T> getCalcValues(pvector<T> &rpnStack) { |
NewerOlder