Instantly share code, notes, and snippets.

View summary.md

12 Rules for Life by Jordan Peterson

  1. stand up straight with your shoulders back
  2. treat yourself like you're someone responsible for helping
  3. make friends with those who want the best for you
  4. compare yourself to who you were yesterday, not to who others are today
  5. don't let your children do anything that makes you dislike them
  6. put your house in perfect order before you criticize the world
  7. do what is meaningful and not what is expedient
  8. tell the truth, or at least don't lie
View event_emitter.go
package main
import (
"fmt"
)
type MyEmitter map[string]chan string
func main() {
myEmitter := MyEmitter{}
View bnjs_example.js
const BN = require('bn.js')
const bn = new BN(Buffer.from('fb2e', 'hex'))
const width = bn.bitLength()
console.log(bn.fromTwos(width).toString()) // -1234
console.log(bn.notn(width).iaddn(1).ineg().toString()) // -1234
View fib_benchmark.js
const Benchmark = require('benchmark')
const suite = new Benchmark.Suite
suite.add('fib#recursion', () => {
fibRec(10)
})
.add('fib#loop', () => {
fibLoop(10)
})
.on('complete', () => {
View .travis.yml
sudo: false
language: node_js
node_js:
- "10"
before_script:
- npm install
script:
- npm test
View .travis.yml
language: go
go:
- "1.10.x"
- "master"
script:
- make test
View generator.go
package main
import "fmt"
func Generator() chan string {
c := make(chan string)
go func() {
c <- "hello"
c <- "world"
View show_reddit_downvote_buttons.js
// ==UserScript==
// @name Reddit Show Downvote Buttons
// @namespace http://tampermonkey.net/
// @version 0.1
// @description The front page of the internet
// @author You
// @match https://www.reddit.com/*
// @grant none
// ==/UserScript==
View send.sh
echo 'hello world' > /dev/udp/0.0.0.0/3000
View send.sh
echo 'hello world' > /dev/udp/0.0.0.0/3000