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 = { | |
use: [ | |
'autoprefixer', | |
'postcss-import', | |
'postcss-url', | |
'postcss-browser-reporter', | |
'postcss-reporter' | |
], | |
input: 'index.css', | |
output: 'dist/bundle.css', |
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
/* `action` and `state` types must be defined before the `let component` statement for type inference to work */ | |
type action = | |
| UpdateEmail string | |
| UpdatePassword string; | |
type state = { | |
email: string, | |
password: string | |
}; |
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
# In your app's root. | |
# Make Pow!! export all the env variables contained in the .env file used by Foreman. | |
export $(cat .env) |
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
const invalidMatchSignal = new Error(); | |
function makeProxyThrower(input) { | |
return new Proxy(input, { | |
get(target, prop, receiver) { | |
if (prop in target) { | |
const result = Reflect.get(target, prop, receiver); | |
if (typeof result === "object" && result !== null) { | |
return makeProxyThrower(result); |
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
PageModule.fetchModule("./MyComponent") | |
|> Js.Promise.then_(m => send(SetRootElement(m()))); |
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 all = Js.Promise.all; | |
let resolve = Js.Promise.resolve; | |
let reject = Js.Promise.reject; | |
let andThen = | |
(p: Js.Promise.t('a), fn: 'a => Js.Promise.t('b)): Js.Promise.t('b) => | |
p->Js.Promise.then_(fn, _); |
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 { Motion, StaggeredMotion, spring } from "react-motion"; | |
import { constant, range } from "lodash"; | |
const DEG_TO_RAD = Math.PI / 180; | |
const MAIN_BUTTON_DIAM = 100; | |
const CHILD_BUTTON_DIAM = 50; | |
const CHILDREN_ICONS = [ | |
"at", "linkedin", "facebook", "github", "twitter" |
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
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} }, | |
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} } |
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 mailer = require('nodemailer') | |
var Hapi = require('hapi') | |
var util = require('util') | |
var template = require('swig') | |
var path = require('path') | |
var PORT = process.env.PORT || 8080 | |
var server = new Hapi.Server(PORT) | |
template.init({ |
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
type validation('a) = | |
| NotEmpty | |
| Custom('a); | |
type t = string; | |
let validate = (rule, value, values) => | |
switch (rule) { | |
| NotEmpty => String.length(value) > 0 | |
| Custom(fn) => fn(value, values) |