Skip to content

Instantly share code, notes, and snippets.

View marcelklehr's full-sized avatar

Marcel Klehr marcelklehr

View GitHub Profile
@marcelklehr
marcelklehr / npm-cli.js
Created July 30, 2016 16:31
Nodist's umbrella against the WebStorm.
/**
This is a shim for the npm binary shim of Nodist.
It exists, so that WebStorm is happy.
See https://github.com/marcelklehr/nodist/issues/158
Instructions:
1. Create the following directory: `Nodist\bin\bin`
2. Place this file in the new directory
*/
var child_process = require('child_process')
npm install
npm install is-color # Only installs is-color
npm install cldr-data # second level dep (of rxaviers-foo-bar)
npm install is-color # Installs is-color + re-installs cldr-data
@marcelklehr
marcelklehr / README.md
Last active July 10, 2017 05:39
gulf-contenteditable example

Simple gulf-contenteditable example

Clone this gist and open index.html in your browser.

git clone https://gist.github.com/marcelklehr/0430be7e3fb45a83189b.git

Check out the source in index.js.

@marcelklehr
marcelklehr / index.js
Last active January 25, 2016 17:49
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var vdom = require('virtual-dom')
, h = vdom.h
var virtualize = createVNode
var vtree = h('div', null, [
h('button', {onclick: function() {
@marcelklehr
marcelklehr / index.js
Last active November 5, 2015 19:09
requirebin example of a virtual-dom UI hook
var ObservStruct = require('observ-struct')
, ObservArray = require('observ-array')
, Computed = require('observ/computed')
, vdom = require('virtual-dom')
, h = vdom.h
var state = ObservStruct({
users: ObservArray([
ObservStruct({id: 0, name: 'foo'})
, ObservStruct({id:1, name: 'bar'})
@marcelklehr
marcelklehr / index.js
Created June 16, 2015 21:21 — forked from Tuch/index.js
requirebin showing off vdom-virtualize's svf goodness
var dom = require('virtual-dom');
var fromHTML = require('vdom-virtualize').fromHTML;
var html = '<svg namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg" height="160" width="160"> <circle namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg-bg" cx="80" cy="80" r="78" stroke="#f2f2f2" stroke-width="4" fill="none" ></circle> <circle namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg-progress" cx="80" cy="80" r="78" stroke="#f9c033" stroke-width="4" fill="none" stroke-dashoffset="228.92" stroke-dasharray="503, 999"></circle> </svg>'
var vsvg = fromHTML(html);
var node = dom.create(vsvg);
document.body.appendChild(node);
@marcelklehr
marcelklehr / checkPadDeltas.js
Last active August 29, 2015 14:01
check etherpad deltas
/*
This is a debug tool. It checks all revisions for data corruption
*/
if(process.argv.length != 3)
{
console.error("Use: node bin/checkPad.js $PADID");
process.exit(1);
}
//get the padID
@marcelklehr
marcelklehr / gist:8586848
Last active January 4, 2016 07:09
etherpad v1.4.0-rc1
* SECURITY FIX: PLugin manager: escape rendered npm package info
* FIX: PLugin manager: Update npm to fix fetching of plugins
* FIX: Import: Dont die on bad html
* FIX: Export: when exporting HTML include html and body
* FIX: Editor: Correct links with protocols that are not equal to http
* FIX: Finally, Update padList correctly
* FIX: Fix walking caret bug (#1766)
* FIX: Add input validation for html param in setHTML()
* FIX: Timeslider: Don't crash if CHANGESET_REQ fails
* FIX: Dont error when pressing del at pos(0,0)
/**
* Find a (minimal) path from a given revision to another revision,
* regardless of what changesets are available
* @param {number} from - The revision # from which to start.
* @param {number} to - The revision # which the path should try to reach.
* @param {number} max - The last revision #
* @returns {object} - A list of tuples (i.e. [10, 20]) which each describe an edge between two revisions.
*/
calcPath: function (from, to, max) {
var path = []
@marcelklehr
marcelklehr / birds
Created November 24, 2013 12:52
Silhouettes of birds
Birds: https://secure.flickr.com/photos/lightlypaintedpixels/50175328/