Skip to content

Instantly share code, notes, and snippets.

View Raynos's full-sized avatar

Jake Verbaten Raynos

View GitHub Profile
function main(initialState, render) {
...
return {
update: function (currentState) {},
elem: ...
}
}
var state = ObservHash({
var marked = require('marked');
var findIndex = require('lodash.findindex');
var doctoc = require('doctoc/lib/transform');
var fs = require('fs');
var path = require('path');
/*
WIP to automate the inclusion of various documentation into
the README.

npm-shrinkwrap

A consistent shrinkwrap tool

Usage

$ npm-shinkwrap

This will run shrinkwrap and then purge your shrinkwrap file of any from fields that are not needed.

exec-callback

Like child_process.exec but uses a node style callback

Example

var exec = require('exec-callback');

exec('git log', function (err, out) {
var render = require('virtual-dom/render');
var diff = require('virtual-dom/diff');
var enqueue = require('virtual-dom/enqueue');
var patch = require('virtual-dom/patch');
module.exports = partial;
/*
type Widget := {
init: () => DOMElement,
@Raynos
Raynos / app.js
Last active August 29, 2015 13:57 — forked from jlongster/app.js
var hash = require('observ-hash')
var array = require('observ-array')
var observ = require('observ')
var dom = React.DOM;
var App = React.createClass({
getInitialState: function() {
// create observable immutable data structure
var state = hash({
@Raynos
Raynos / js--.md
Last active August 29, 2015 13:57

JavaScript minus minus (JS--)

A slimmed down version of javascript without features.

Features

Module system

import is syntax, not a function, not dynamic.

var _fs = process.binding('fs');
var _close = _fs.close
_fs.close = function (fd, cb) {
console.log('closing', fd, new Error().stack)
_close.call(_fs, fd, cb)
}

events

Doing it raw

You just add an event listener to your element

elem.addEventListener(eventType, listener)