Skip to content

Instantly share code, notes, and snippets.

@tornqvist
tornqvist / package.json
Last active September 14, 2015 08:57
npm scripts setup for testing SUIT CSS and JavaScript
{
"name": "my-module",
"version": "1.0.0",
"author": "Carl Törnqvist <[email protected]>",
"scripts": {
"test": "npm run lint:js && npm run lint:css",
"lint:js": "eslint ./components",
"lint:css": "postcss -u postcss-bem-linter -u postcss-reporter --postcss-reporter.throwError true -d $TMPDIR ./components/**/*.css"
},
"devDependencies": {

Keybase proof

I hereby claim:

  • I am tornqvist on github.
  • I am tornqvist (https://keybase.io/tornqvist) on keybase.
  • I have a public key ASDWh8Y2mf6L3E_f95VsOI-vcBA87HOWb9-UH1UqhhFDhQo

To claim this, I am signing this object:

@tornqvist
tornqvist / index.js
Last active May 14, 2017 11:26
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
const html = require('bel');
const Nanocomponent = require('nanocomponent');
const morph = require('nanomorph');
const Component = function () {
this.greetee = 'who';
Nanocomponent.call(this);
@tornqvist
tornqvist / cloudSettings
Created May 23, 2017 18:09
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-05-23T18:09:42.685Z","extensionVersion":"v2.8.0"}
@tornqvist
tornqvist / index.js
Created August 2, 2017 12:14
requirebin sketch
const html = require('bel');
const string = require('pelo');
document.body.innerHTML = string`
<input disabled=${ false } placeholder="Wut, I'm disabled?" />
`;
document.body.appendChild(html`
<input disabled=${ false } placeholder="I'm not disabled!" />
`);
@tornqvist
tornqvist / index.js
Last active October 31, 2017 12:38
requirebin sketch
var html = require('bel')
var assert = require('assert')
var Nanocomponent = require('nanocomponent')
function Component (name) {
Nanocomponent.call(this, name)
this.cache = {}
}
Component.prototype = Object.create(Nanocomponent.prototype)
@tornqvist
tornqvist / index.js
Created November 3, 2017 08:06
requirebin sketch
var html = require('bel')
var assert = require('assert')
var morph = require('nanomorph')
var Nanocomponent = require('nanocomponent')
function Component (name) {
Nanocomponent.call(this, name)
}
Component.prototype = Object.create(Nanocomponent.prototype)
@tornqvist
tornqvist / index.js
Created November 3, 2017 08:06
requirebin sketch
var html = require('bel')
var assert = require('assert')
var morph = require('nanomorph')
var Nanocomponent = require('nanocomponent')
function Component (name) {
Nanocomponent.call(this, name)
}
Component.prototype = Object.create(Nanocomponent.prototype)
@tornqvist
tornqvist / index.js
Created November 3, 2017 08:06
requirebin sketch
var html = require('bel')
var assert = require('assert')
var morph = require('nanomorph')
var Nanocomponent = require('nanocomponent')
function Component (name) {
Nanocomponent.call(this, name)
}
Component.prototype = Object.create(Nanocomponent.prototype)
@tornqvist
tornqvist / button.js
Last active December 18, 2017 12:33
Choo cache thing
var html = require('choo/html')
var cache = require('choo/cache')
var Nanocomponent = require('nanocomponent')
class Button extends Nanocomponent {
// this is where you'd implement custom gc logic
static discard (instance) {
return !instance.element
}