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
| #This sets the environment variable for Fish shell (http://fishshell.com/). Change for bash/zsh. | |
| set -g -x SKIP_SASS_BINARY_DOWNLOAD_FOR_CI true | |
| cd node_modules | |
| #If you are using ember-cli-sass first change your package.json to | |
| #"ember-cli-sass": "git+https://github.com/aexmachina/ember-cli-sass#sources-content" | |
| #and cd node_modules/ember-cli-sass/node_modules/broccoli-sass/node_modules/ | |
| rm -rf node-sass | |
| git clone --recursive https://github.com/sass/node-sass.git | |
| cd node-sass |
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
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
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 eachKey(obj, f) { | |
| for(var key in obj) { | |
| if( obj.hasOwnProperty(key) ) | |
| f(key, obj[key]); | |
| } | |
| } | |
| function adtcase (base, proto, key) { | |
| return (...args) => { | |
| var inst = new base(); |
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 daggy = require('daggy') | |
| const {compose, curry, map, prop, identity, intersection, union} = require('ramda'); | |
| const inspect = (x) => { if(!x) return x; return x.inspect ? x.inspect() : x; } | |
| // F-algebras | |
| // Fix | |
| // ============ | |
| // Fx is a simple wrapper that does almost nothing. It's much more useful in typed languages to check that we have a recursive f (Fix f) |
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
| //https://gist.github.com/quelgar/4661081 | |
| const daggy = require('daggy'); | |
| const {range} = require('ramda'); | |
| // type to hold an index and the array | |
| const Pointer = daggy.tagged('i', 'a') | |
| // Comonad instance | |
| Pointer.prototype.extract = function() { return this.a[this.i] } |
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
| // http://www.haskellforall.com/2013/02/you-could-have-invented-comonads.html | |
| const daggy = require('daggy'); | |
| const {toUpper, prop, identity, range, curry, compose} = require('ramda'); | |
| const Config = daggy.tagged("opts") | |
| Config.prototype.inspect = function() { | |
| return `Config(${this.opts})` | |
| } |
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
| // AttributedString class from https://github.com/cohitre/attributedString.js | |
| // Modifications made to support html tags & remove span wrapper from unstyled blocks | |
| var AttributedString = (function () { | |
| var aString | |
| , StringRange | |
| , RangesList | |
| , HtmlSerializer | |
| , plainStringSerializer | |
| , _ = {} | |
| , entityMap = { |
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 jsdom = require('jsdom').jsdom | |
| const fs = require('fs') | |
| const path = require('path') | |
| const { | |
| ContentState, | |
| convertToRaw, | |
| convertFromRaw, | |
| } = require('draft-js') | |
| const React = fs.readFileSync(path.join(__dirname, '../node_modules/react/dist/react.js')) |
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 http = require('http'); | |
| // Swagger-like API description | |
| const api = { | |
| '/users': { | |
| 'get': { | |
| 'parameters': { | |
| 'role': { | |
| 'in': 'query' | |
| }, |
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
| #!/usr/bin/env node | |
| import { IO, Try, Success, Failure, Either, Left, Right, Cancelable, Duration } from "funfix" | |
| import { RequestResponse } from "request" | |
| import * as fs from "fs" | |
| import * as request from "request" | |
| import * as Url from "url" | |
| import * as cheerio from "cheerio" | |
| import * as minimist from "minimist" |