Skip to content

Instantly share code, notes, and snippets.

View bollwyvl's full-sized avatar

Nicholas Bollweg bollwyvl

View GitHub Profile
@bollwyvl
bollwyvl / minify.py
Created February 21, 2014 21:08
A quick and dirty script to use online services to generate minified versions of js and css files next to the originals, such as for CDNJS.
import os
import fnmatch
from urllib import urlopen, urlencode
services = {
"css": "http://cssminifier.com/raw",
"js": "http://javascript-minifier.com/raw"
}
for ext, url in services.items():
@bollwyvl
bollwyvl / fetch.js
Last active August 29, 2015 14:00
Find (package|bower|component|composer).json commonality
var fs = require('fs'),
path = require('path'),
request = require('request'),
diff = require('jsondiffpatch'),
cJSON = require('canonical-json'),
_ = require('lodash'),
async = require('async'),
@bollwyvl
bollwyvl / index.html
Last active August 29, 2015 14:02 — forked from makoto/index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg {
font: 10px sans-serif;
}
.border {
color: yellow;
@bollwyvl
bollwyvl / README.md
Last active August 29, 2015 14:02
IPython Livecoding Hack with Inlet.js

While widgets provide the best way to enable bidirectional communication between the Notebook and the kernel this approach, borrowed from Bret Victor's talk Inventing on Principal and implemented with Ian Johnson's Inlet.js is kind of fun.

Once this is installed, clicking on a number (int, float... or scientific notation!) or a hex/hsl color, and a visual tool (slider or color picker) will show up.

Installation

You can copy and paste the ipython-inlet.js file in a Notebook cell with %%javascript uncommented, it should take care of everything. You could probably also do some kind of magic with requirejs, but I don't

@bollwyvl
bollwyvl / index.html
Created July 1, 2014 22:09
JSON Hyperground
<!DOCTYPE html>
<link rel="stylesheet" href="./lib/bootstrap/dist/css/bootstrap.css"></link>
<link rel="stylesheet" href="./lib/fontawesome/css/font-awesome.css"></link>
<link rel="stylesheet" href="./lib/bootswatch/cyborg/bootstrap.css"></link>
<link rel="stylesheet" href="./lib/codemirror/lib/codemirror.css"></link>
<link rel="stylesheet" href="./lib/codemirror/theme/monokai.css"></link>
<style>
html {
height: 100%;
@bollwyvl
bollwyvl / JSONLD.jsonld
Created July 2, 2014 20:59
JSON-LD (in JSON-LD) for xtypes
{
"@context": {
"xtypes": "http://purl.org/xtypes/",
"foaf": "http://xmlns.com/foaf/0.1/",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"owl": "http://www.w3.org/2002/07/owl#",
"dcterms": "http://purl.org/dc/terms/",
"label": "rdfs:label",
"subClassOf": {
"@type": "@id",
@bollwyvl
bollwyvl / server.js
Created July 8, 2014 21:49
jsonresume registry-server with jsonld
var express = require("express");
var Mustache = require('mustache');
var resumeToText = require('resume-to-text');
var path = require('path');
var resumeToHTML = require('resume-to-html');
var resumeToMarkdown = require('resume-to-markdown');
var bodyParser = require('body-parser');
var bcrypt = require('bcrypt-nodejs');
var gravatar = require('gravatar');
var app = express();
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>d3.carto.map - d3.carto.layer</title>
<meta charset="utf-8" />
<link type="text/css" rel="stylesheet" href="https://raw.githubusercontent.com/emeeks/d3-carto-map/master/d3map.css" />
<link type="text/css" rel="stylesheet" href="https://raw.githubusercontent.com/emeeks/d3-carto-map/master/examples/example.css" />
</head>
<style>
html,body {
height: 100%;
@bollwyvl
bollwyvl / README.md
Last active August 29, 2015 14:04 — forked from jstcki/README.md
d3.layout.grid with icons