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
#!/usr/bin/env node | |
// Clean up JSON from openlibrary.org and output as NDJSON. | |
// use: | |
// curl 'http://openlibrary.org/subjects/love.json' | ./toNdjson.js | |
var JSONStream = require('JSONStream'); | |
var map = require('through2-map'); | |
var cherryPick = map.obj(function(obj) { | |
return { |
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 loop = require('vdom-loop'); | |
var xtend = require('xtend'); | |
var observify = require('observify'); | |
var oStruct = require('observ-struct'); | |
var oArray = require('observ-array'); | |
var observ = require('observ'); | |
var form = require('virtual-form'); | |
var h = loop.h; | |
var fields = [ |
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
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
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
#!/bin/sh | |
usage () { | |
printf "Usage: build-umd <argument>\n" | |
} | |
# use zopfli for better compression if available | |
gzip () { | |
zopfli -h 2>/dev/null | |
if [ $? -eq 0 ]; then |
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
// see https://github.com/karissa/karissa.github.io/blob/master/js/force.js | |
var d3 = require('d3') | |
var json = { | |
nodes: [ | |
{name: 'karissa', image: '/images/github.ico', url: 'http://github.com/karissa'}, | |
{name: '@okdistribute', image: '/images/twitter.ico', url: 'http://twitter.com/okdistribute'}, | |
{name: 'karissamck', image: '/images/linkedin.ico', url: 'https://www.linkedin.com/in/krmckelv'}, | |
{name: 'karissa.mckelvey', image: '/images/facebook.ico'}, | |
{name: 'indiana', image: '/images/indiana.ico', url: 'http://indiana.edu'}, |
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
alias oneline="tr -d '\n' | tr -s ' ' | sed -e '\$a\\'" | |
alias random="node -e \"console.log(require('crypto').randomBytes(32).toString('hex'));\"" | |
alias lsd="ls -lF -G | grep --color=never '^d'" | |
# IP addresses | |
alias ip="dig +short myip.opendns.com @resolver1.opendns.com" | |
# Trim new lines and copy to clipboard | |
alias c="tr -d '\n' | pbcopy" |
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 cypress = require('cypress') | |
var Budo = require('budo') | |
var getPort = require('getport') | |
getPort(9966, function (err, port) { | |
if (err) throw err | |
var budo = Budo.cli(process.argv.slice(2), { | |
port | |
}).on('connect', function () { |
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
# Javascript Node CircleCI 2.0 configuration file | |
# | |
# Check https://circleci.com/docs/2.0/language-javascript/ for more details | |
# | |
version: 2 | |
jobs: | |
build: | |
docker: | |
# specify the version you desire here | |
- image: cypress/browsers:chrome67 |
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
{ | |
"scripts": { | |
"start": "node-sass src/style/main.scss --source-map-embed > public/style.css && concurrently --kill-others \"npm run serve\" \"npm run sass-watch\"", | |
"serve": "env $(cat .env | xargs) VERSION=`cat package.json | json version` budo src/index.js:bundle.js --pushstate --dir=public --live -- -t babelify -g aliasify -t [ envify --NODE_ENV development ] -dv", | |
"cypress-ci": "start-server-and-test start http://localhost:9966 cy:run", | |
"cy:run": "cypress run --config baseUrl=\"http://localhost:9966\"" | |
}, | |
"devDependencies": { | |
"start-server-and-test": "^1.7.11", | |
} |
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 webcrypto = window.crypto | |
import * as uint8arrays from 'uint8arrays' | |
// data should be Uint8Array | |
function getHash (data) { | |
let _data = data | |
if (typeof data === 'string') { | |
const te = new TextEncoder() | |
_data = te.encode(data) |
OlderNewer