Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am kareniel on github.
  • I am kareniel (https://keybase.io/kareniel) on keybase.
  • I have a public key whose fingerprint is 1372 AA3A 84DD 77F4 E29C 8CA8 A941 EDCA 8927 63BD

To claim this, I am signing this object:

<script>alert('ok')</script>
@kareniel
kareniel / Model.js
Created June 23, 2018 17:00
Reactivity in Choo
var Component = require('choo/component')
const NO_COMPONENT = 'Model constructor expects a Component as first argument.'
module.exports = class Model {
constructor (component, opts) {
if (!component || !(component instanceof Component)) {
throw new Error(NO_COMPONENT)
}
game meat
nuts
berries
some vegetables
@kareniel
kareniel / wordlist.txt
Created May 28, 2018 20:34
Oren Tirosh’s mnemonic encoding project
taken from http://web.archive.org/web/20091003023412/http://tothink.com:80/mnemonic/wordlist.txt
These 1633 words were chosen very specifically to be short (4-7 letters),
phonetically different from one another, easy to understand over the phone,
and also recognizable internationally.
Wordlist ver 0.732 - EXPECT INCOMPATIBLE CHANGES;
acrobat africa alaska albert albino album
alcohol alex alpha amadeus amanda amazon
america analog animal antenna antonio apollo
@kareniel
kareniel / Person.js
Last active March 26, 2018 15:27
c# interfaces in js using mixins
// original idea from https://github.com/justinfagnani/mixwith.js
const _cachedApplications = '__cachedApplications';
class SuperClass ()
{
constructor (superclass)
{
return new MixinBuilder(superclass)
}
@kareniel
kareniel / enums.md
Created March 15, 2018 01:43
make use of objects and numbers to make custom enums

option a

i use uppercase to make more explicit the use of a constant

var directions = { UP : 0, RIGHT: 1, ... }

this.direction = directions.UP
example of props:
selectedIndex
tagName
nodeName
nodeType
ownerDocument
defaultChecked
defaultSelected
var Nanocomponent = require('nanocomponent')
var nanostate = require('nanostate')
module.exports = Component
function Component (el) {
if (!(this instanceof Component)) return new Component(el)
this._el = el
@kareniel
kareniel / 1.sh
Created January 15, 2018 20:45
code blocks for post about pelias
git clone https://github.com/pelias/dockerfiles.git