Skip to content

Instantly share code, notes, and snippets.

View curry.ts
declare type Curry<P, V> =
P extends [infer A, infer B, infer C, infer D] ? (a: A) => Curry<[B, C, D], V> :
P extends [infer A, infer B, infer C] ? (a: A) => Curry<[B, C], V> :
P extends [infer A, infer B] ? (a: A) => Curry<[B], V> :
P extends [infer A] ? (a: A) => V :
() => V; // could be unknow, but this allows to safely pass parameterless functions
declare function curry<T extends any[], R>(fn: (...args: T) => R): Curry<T, R>;
View typescript-builder-pattern.ts
// Builders
class SimpleBuilder {
constructor(private current = {}) {
}
prop(key: string, value: any) {
return new SimpleBuilder({ ...this.current, ...{ [key]: value } });
}
@emiaj
emiaj / app.html
Last active May 21, 2016 — forked from charlespockert/add-suffix.js
Base Aurelia Gist
View app.html
<template>
<require from="nav-bar.html"></require>
<require from="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></require>
<nav-bar router.bind="router"></nav-bar>
<div class="page-host" style="margin-top:50px">
<router-view></router-view>
</div>
</template>
View main.js
require.config({
paths: {
'rest': '/webjars/Rest/' + webjars.versions['Rest'],
'when': '/webjars/when-node/' + webjars.versions['when-node']
},
map: {
'rest': {
'when': 'when/when',
'when/lib':'when/lib'
}
View nginx.conf
server {
access_log /var/logs/nginx/a/access.log;
error_log /var/logs/nginx/a/error.log;
listen 443 ssl;
server_name ServiceA.local.io;
location / {
proxy_pass http://10.0.0.2$request_uri;
}
View gist:df9f713b0f1328c45a4b
ENV NGINX_SERVICES_A_ADDRESS 10.0.0.2
ENV NGINX_SERVICES_A_NAME ServiceA
ENV NGINX_SERVICES_A_SHORTNAME a
ENV NGINX_SERVICES_B_ADDRESS 10.0.0.3
ENV NGINX_SERVICES_B_NAME ServiceB
ENV NGINX_SERVICES_B_SHORTNAME b
View Dockerfile
from busybox
VOLUME /var/shared
RUN touch /var/shared/placeholder
@emiaj
emiaj / Experiments.purs
Last active Aug 29, 2015
>> Make failed: >> Error at src/Data/Experiments.purs line 9, column 20: >> Error in module Data.Experiments >> Unknown data constructor 'Directory'
View Experiments.purs
module Data.Experiments where
import Data.Array
import Data.Foldable
import Data.Path
import FileOperations
onlyFiles :: Path -> [Path]
onlyFiles (Directory name paths) = []
onlyFiles _ = []
View experiment.purs
module Data.Experiments where
import Math
import Data.Array
import Control.MonadPlus
(..) :: Number -> Number -> [Number]
(..) = range
triples :: Number -> [[Number]]
triples n = do
View index.js
"use strict";
var Prelude = require("Prelude");
var Math = require("Math");
var isEven = function (__copy__36) {
var _36 = __copy__36;
tco: while (true) {
if (_36 === 0) {
return false;
};
if (_36 === 1) {
You can’t perform that action at this time.