Skip to content

Instantly share code, notes, and snippets.

View jemgold's full-sized avatar
👽
vibing

Jem jemgold

👽
vibing
View GitHub Profile
/**
* COMMON WEBPACK CONFIGURATION
*/
const path = require('path')
const webpack = require('webpack')
module.exports = (options) => {
return {
entry: options.entry,
/* eslint no-console:0 */
// Gets called when running npm start
const path = require('path')
// const url = require('url')
// const http = require('http')
const webpack = require('webpack')
const WebpackDevServer = require('webpack-dev-server')
const config = require('./webpack.dev.babel')
const ip = require('ip')
import React, { Component } from 'react';
import IPropTypes from 'react-immutable-proptypes';
import topojson from 'topojson';
import classNames from 'classnames';
import d3 from 'd3';
import { compose, contains, find, pluck, prop, propEq } from 'ramda';
import world110m from 'json!./out.json';
import states from 'json!./states.topojson';
import { join, map, pipe, split, take, toLower } from 'ramda'
import { getFreeFonts } from './parselist'
import { createReadStream } from 'fs'
import { parse } from 'csv'
import { loadDetailPage } from './scrapefontwolf'
const csvParser = parse({ delimiter: ',' }, (err, data) => {
if (err) throw err
pipe(
take(5),
import Xray from 'x-ray'
const x = Xray()
import { find, whereEq } from 'ramda'
import { defer } from 'q'
const nextPage = '.pagination-custom .btn-more:nth-child(2)@href'
// x('https:/www.typewolf.com/open-source-web-fonts', 'div.item', ['.item-title']
// // title: '.item-title a'//,
// // // description: x('.item-title a@href', '.section-subtitle')
@jemgold
jemgold / a.md
Last active November 12, 2015 20:26

hope this makes sense. I had a list of objects like this:

const xs = [
  { foo: 2, bar: 2, baz: 3 },
  { qux: 1, bar: 0.5 },
  { foo: 3, bar: 2, qux: 4 },
]

that I wanted to turn into a single object, by passing a function to merge similar keys/values.

import trainingSet from './fw.json'
import { __, add, countBy, curry, difference, head, identity, intersection, keys, lensProp, map, mapObjIndexed, mergeAll, multiply, over, pick, pipe, prepend, prop, reduce, split, view, zipWith } from 'ramda'
import { indexBy, log, mergeWith, without } from '../utils'
// Lenses
const titleL = lensProp('title')
const pairingsL = lensProp('pairings')
// String -> String
import { curry, equals, groupBy, head, mapObj,
mapObjIndexed, prop, reject, tap } from 'ramda'
/**
* takes a function and two objects
* merges them by applying fn to
* the same k/v in each.
*
* @func
* @sig (a,a -> a) -> {k: v} -> {k: v} -> {k: v}
opentype = require 'opentype.js'
R = require 'ramda'
fonts =
openSans:
url: 'fonts/apache/opensans'
file: 'OpenSans-Regular.ttf'
roboto:
url: 'fonts/apache/roboto'
file: 'Roboto-Regular.ttf'
@jemgold
jemgold / index.js
Created June 20, 2015 11:07
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
Immutable = require('immutable');
Reflux = require('reflux')
React = require('react');
var a = Immutable.Range(0, 10).map(function(x) {
return x * 100;
});