Skip to content

Instantly share code, notes, and snippets.

class ReactComponent extends Component {
constructor (props) {
super(props)
this.classMethod = this.classMethod.bind(this)
}
classMethod () {
// do soemthing with 'this'
}
bret-mbr:testrun bret$ node generate.js
key is <Buffer 09 19 de 78 56 e7 dc 1a a8 c4 88 d5 1a b9 5d e7 4c 20 5e 5c e6 6e 94 12 6e 14 4e b5 13 10 e7 ca>
_stream_readable.js:561
var ret = dest.write(chunk);
^
TypeError: dest.write is not a function
at ReadStream.ondata (_stream_readable.js:561:20)
at emitOne (events.js:96:13)
at ReadStream.emit (events.js:188:7)
@bcomnes
bcomnes / .gitignore
Last active June 22, 2016 17:15
Testing random-access-http and hypercore
node_modules
*.db
*.mp4
firewall {
all-ping enable
broadcast-ping disable
ipv6-receive-redirects disable
ipv6-src-route disable
ip-src-route disable
log-martians enable
name WAN_IN {
default-action drop
description "WAN to internal"
package main
import (
"encoding/base64"
"fmt"
"os"
"strings"
)
const (
10:53 <bret> i like how react/redux works. i don't like the tool chain very much
10:54 <bret> its a good place to start to understand how view systems that take the always re-render strategy like react does
10:54 <bret> there are alternatives that are less documented but more minimal: https://github.com/Raynos/mercury
10:55 <substack> yo-yo or virtual-dom+main-loop are pretty nice alternatives that give you the basic architecture without the toolchain complexity
10:55 <substack> or bloat
10:55 <bret> https://github.com/shama/bel yeah yo yo too
10:55 <minskmaz> yeah my biggest complaint compes from from simple abstractions becoming huge apis
10:56 <substack> minskmaz: yo-yo/bel and virtual-dom/main-loop are basically finished except for bug fixes and extremely minor feature additions
10:56 <minskmaz> substack: I’ll check it out - how is it for 2 way binding ?
10:57 <substack> instead of 2-way binding, I use an event emitter to trigger state transitions
@bcomnes
bcomnes / delete_merged.sh
Created April 30, 2016 01:15
Delete merged branches on git
#!/usr/bin/env bash
git branch -r --merged |
grep origin |
grep -v '>' |
grep -v 'master' |
xargs -L1 |
awk '{sub(/origin\//,"");print}' |
xargs git push origin --delete
@bcomnes
bcomnes / keybase.md
Created April 25, 2016 20:17
keybase.md

Keybase proof

I hereby claim:

  • I am bcomnes on github.
  • I am bret (https://keybase.io/bret) on keybase.
  • I have a public key ASBJBZN99sITUk1GqwHTTFKVnUqSJlWGQs62TR76dFQ-awo

To claim this, I am signing this object:

@bcomnes
bcomnes / git-gpg.md
Last active December 14, 2024 13:50
my version of gpg on the mac
  1. brew install gnupg, pinentry-mac (this includes gpg-agent and pinentry)

  2. Generate a key: $ gpg --gen-key

  3. Take the defaults. Whatevs

  4. Tell gpg-agent to use pinentry-mac:

    $ vim ~/.gnupg/gpg-agent.conf 
    
@bcomnes
bcomnes / .eslintrc
Last active March 15, 2016 22:50
.eslintrc
{
"parser": "babel-eslint",
"extends": ["standard", "standard-react"],
"env": { "browser": true, "node": true },
"rules": { "no-var": 2 }
}