Skip to content

Instantly share code, notes, and snippets.

View hew's full-sized avatar

Matt hew

View GitHub Profile
module.exports = {
use: [
'autoprefixer',
'postcss-import',
'postcss-url',
'postcss-browser-reporter',
'postcss-reporter'
],
input: 'index.css',
output: 'dist/bundle.css',
@Zerim
Zerim / SignupForm.re
Last active February 19, 2018 23:25
A simple SignupForm written in ReasonML
/* `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
};
@dre1080
dre1080 / .powenv
Last active March 21, 2018 14:06
Using Pow!! with Foreman (Configuration)
# In your app's root.
# Make Pow!! export all the env variables contained in the .env file used by Foreman.
export $(cat .env)
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);
@mhallin
mhallin / App.re
Created August 6, 2018 11:45
Async import pattern
PageModule.fetchModule("./MyComponent")
|> Js.Promise.then_(m => send(SetRootElement(m())));
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, _);
@BinaryMuse
BinaryMuse / complete.js
Last active June 13, 2019 03:30
DND: Blog Post - Staggered Animation with React Motion
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"
@coldnebo
coldnebo / Default (OSX).sublime-keymap -- User
Created February 3, 2012 16:21
Sublime Text 2 fix for OSX home/end keys
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} }
@niallo
niallo / app.js
Created March 2, 2013 00:43
Quick and dirty landing page & contact form server in node.js, uses hapi.js, swig and nodemailer.
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({
@busypeoples
busypeoples / FormExample.re
Created April 23, 2018 00:20
Form Example in ReasonML
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)