Update: As package.elm-lang.org IP address has been changed and is not blocked anymore as far as I know, these proxies have been disabled. If you still need them, add a comment describing why.
Here is how to use the proxies:
Two options:
import express from 'express' | |
import { createRest } from 'createrest' | |
import { createRestExpress } from 'createrest-express' | |
import { AuthController } from 'controllers' | |
const app = express() | |
const routes = createRest(r => { | |
r.resources('auth', AuthController, { methodNames: { create: 'login' } }) |
// README and npm module https://www.npmjs.com/package/date-template | |
/** | |
*@function | |
*@name dateTemplate | |
*@param {string} format - ~Y~ ~M~ ~Dw~ ~D~ ~h~ ~m~ ~s~ ~mm~ | |
*@param {number} oldDate - milliseconds time OR Date object | |
*@param {function} middleware - Change the date type | |
*/ | |
const dateTemplate = function( format, oldDate, middleware ){ | |
let date = oldDate ? new Date(oldDate) : new Date(); |
open Webapi.Dom; | |
open Webapi.Canvas.Canvas2d; | |
open Webapi.Canvas.CanvasElement; | |
[@bs.set] external setWidth: (Dom.element, int) => unit = "width"; | |
[@bs.set] external setHeight: (Dom.element, int) => unit = "height"; | |
type point = (float, float); | |
type shape('s, 'a) = { |
function curried(fn) { | |
var args = Array.prototype.slice.call(arguments, 1); | |
return function() { | |
return fn.apply(this, args.concat(Array.prototype.slice.call(arguments, 0))); | |
} | |
} | |
import Html exposing (text) | |
type NodeF v a | |
= Empty v | |
| Elem (List a) | |
nodeMap : (a -> b) -> NodeF v a -> NodeF v b | |
nodeMap f node = | |
case node of | |
Empty v -> Empty v |
Update: As package.elm-lang.org IP address has been changed and is not blocked anymore as far as I know, these proxies have been disabled. If you still need them, add a comment describing why.
Here is how to use the proxies:
Two options:
Is IE8 your new IE6? Level the playing field with polyfills.
This script polyfills addEventListener, removeEventListener, and dispatchEvent. It is less than half a kilobyte minified and gzipped.
addEventListener registers a single event listener on a single target.
'use strict'; | |
////////////////////////////////// | |
// How to use? | |
// 1. Create `sequelize-schema-file-generator.js` in your app root | |
// 2. Make sure you've ran the `sequelize init` before (It should create `config`,`seeders`,`migrations` folders). | |
// 3. Update `DATABASE_DSN` below to match your connection string (works with any database adapter that Sequelize supports) | |
// 4. Run it with `node sequelize-schema-file-generator.js` | |
// 5. Review the generated migrations inside of the `migrations` folder. | |
////////////////////////////////// |
const path = require('path'); | |
class DependencyGraphPlugin { | |
apply(compiler) { | |
compiler.hooks.emit.tap("DependencyGraphPlugin", (compilation) => { | |
let deps = []; | |
compilation.modules.forEach(m => { | |
// console.log(m) | |
const file = path.relative('', m.resource) |
// FP Lenses | |
const lens = get => set => ({ get, set }); | |
const view = lens => obj => lens.get(obj); | |
const set = lens => val => obj => lens.set(val)(obj); | |
const over = lens => fn => obj => set(lens)(fn(view(lens)(obj)))(obj); | |
const lensProp = key => lens(prop(key))(assoc(key)); |