Skip to content

Instantly share code, notes, and snippets.

View Raynos's full-sized avatar

Jake Verbaten Raynos

View GitHub Profile
var h = require("virtual-hyperscript");
// Children as arguments[2]
h("div", {
"aria-hidden": true,
"ev-click": onClick,
}, [
h("p", {
"aria-hidden": true,
@Raynos
Raynos / index.js
Created July 23, 2014 02:51 — forked from jfsiii/index.js
requirebin sketch
var diff = require('virtual-dom/diff');
var patch = require('virtual-dom/patch');
var h = require('virtual-dom/h');
var createElement = require('virtual-dom/create-element');
var virtualize = require('vdom-virtualize');
// 1: Create a function that declares what the DOM should look like
function render(count) {
// var html = '<div id="test">Count is <span>' + count + '</span></div>';
//return virtualize.fromHTML(html);
var setTimeout = require('timers').setTimeout;
var work = 0;
console.log('version: ' + process.version);
if (typeof gc === 'undefined') {
throw new Error('run node foo.js --expose-gc');
}
var people = varhash({}, function setPerson (obj, key), {
return struct({
id: key,
name: value(obj.name)
})
})
var teams = varhash({}, function setTeam (obj, key) {
return struct({
id: key,
@Raynos
Raynos / index.js
Last active August 29, 2015 14:02 — forked from neonstalwart/index.js
var mercury = require("mercury")
var h = mercury.h
var state = mercury.hash({})
function render(state) {
return h("ul", [
h('li', h('a', { href: '#foo' }, 'link without array')),
h('li', [ h('a', { href: '#bar' }, 'link with array') ])
])
@Raynos
Raynos / thunk.js
Last active August 29, 2015 13:57 — forked from Matt-Esch/thunk.js
var cuid = require("cuid")
var dom = require("./render")
var diff = require("./diff")
var patch = require("./patch")
var isString = require("./lib/is-string")
/* Usage
var thunk = require("virtual-dom/thunk")
@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({

why ./task.js?

One word: task automation. It's basically zero effort and you can use the ./task.js package manager to handle any repetitive tasks. You can use ./task.js to automate everything with minimum effort.

./task.js provides the structure, order, and authority that you as a developer so desperately crave. ./task.js will also take responsibility for your actions if you need it to. It's what everybody is using now. ./task.js is the new hotness. It's all about ./task.js now, just like that.

This is compared to npm run/bash scripts, which are:

@Raynos
Raynos / x.js
Last active January 2, 2016 01:29
// don't pass monk in as an argument, just require it
var monk = require("monk")
var rule = require("monk/rule")
var less = require("monk-less");
var compress = require("monk-compress")
// don't exports.x = bar
// just create functions.
function build() {
// don't have magic glob or mapFile. Just have sensible defaults
var task = require("monk")
var shell = require("monk-shell")
var buildTask = task("build", function (rule) {
rule("hello.c", "hello.o",
shell("gcc -Wall -c %i -o %o"))
rule("square.c", "square.o",
shell("gcc -Wall -c %i -o %o"))