Skip to content

Instantly share code, notes, and snippets.

View kiasaki's full-sized avatar
🚧
Building many things

kiasaki kiasaki

🚧
Building many things
View GitHub Profile
@kiasaki
kiasaki / container.js
Last active November 22, 2015 18:56
Node.js architecture blog post (container.js)
import R from 'ramda';
export default class Container {
constructor() {
this.contents = {};
}
get(name) {
if (!(name in this.contents)) {
throw Error('Container has nothing registered for key ' + name);
@kiasaki
kiasaki / c-coding-style.txt
Created September 23, 2015 17:42
Kinux Kernel C Coding Style
The coding conventions match with the Linux kernel guideline, so here
we go with a copy of the Linux kernel coding style:
Linux kernel coding style
This is a short document describing the preferred coding style for the
linux kernel. Coding style is very personal, and I won't _force_ my
views on anybody, but this is what goes for anything that I have to be
able to maintain, and I'd prefer it for most other things too. Please
at least consider the points made here.
@kiasaki
kiasaki / instructions.md
Last active August 29, 2015 14:27
PostgreSQL new project

Open a psql session (generally psql postgres if installed with homebrew on mac)

Then:

CREATE ROLE "<user_name>" WITH SUPERUSER LOGIN PASSWORD '<user_password>';
CREATE DATABASE "<database_name>" WITH OWNER "<user_name>";
@kiasaki
kiasaki / keybase.md
Created May 26, 2015 18:29
keybase.md

Keybase proof

I hereby claim:

  • I am kiasaki on github.
  • I am kiasaki (https://keybase.io/kiasaki) on keybase.
  • I have a public key whose fingerprint is 45BA A869 F53B 64AC F582 C7A1 2D5E F720 F02F A2A4

To claim this, I am signing this object:

2015/04/25 21:57:22 INF 1 (127.0.0.1:4160) connecting to nsqd
2015/04/25 21:57:22 INF 2 (127.0.0.1:4160) connecting to nsqd
2015/04/25 21:57:22 INF 3 (127.0.0.1:4160) connecting to nsqd
2015/04/25 21:57:22 INF 4 (127.0.0.1:4160) connecting to nsqd
2015/04/25 21:57:22 INF 5 (127.0.0.1:4160) connecting to nsqd
2015/04/25 21:57:22 INF 6 (127.0.0.1:4160) connecting to nsqd
2015/04/25 21:57:22 INF 7 (127.0.0.1:4160) connecting to nsqd
2015/04/25 21:57:22 ERR 5 (127.0.0.1:4160) IO error - read tcp 127.0.0.1:4160: connection reset by peer
2015/04/25 21:57:22 INF 5 (127.0.0.1:4160) beginning close
2015/04/25 21:57:22 INF 5 (127.0.0.1:4160) readLoop exiting
@kiasaki
kiasaki / README.md
Last active August 29, 2015 14:18
eslint pre-commit hook

To install:

curl -o .git/hooks/pre-commit http://git.io/jSry
chmod +x .git/hooks/pre-commit
! terminal colors ------------------------------------------------------------
! tangoesque scheme
*background: #111111
*foreground: #babdb6
! Black (not tango) + DarkGrey
*color0: #000000
*color8: #555753
! DarkRed + Red
*color1: #ff6565
@kiasaki
kiasaki / readme.md
Created February 20, 2015 08:29
Arch linux install

Installing - Partitionning, mounting, bootstrapping

  • efibvars -l
    • Make sure you see some
  • lsblk
  • lsblk -f
  • cgdisk /dev/sda
    • ddd
    • n -> enter -> 24500000 -> enter -> root
  • n -> enter -> enter -> enter -> boot (min 500mb)
@kiasaki
kiasaki / setup.sh
Last active August 29, 2015 14:15
Script to setup a vm in a minimum usable state
set -e
sudo apt-get update -y
sudo apt-get install -y curl tmux vim git bzr htop
curl -o $HOME/go.tar.gz https://storage.googleapis.com/golang/go1.4.1.linux-amd64.tar.gz
tar -xzf $HOME/go.tar.gz
rm $HOME/go.tar.gz
sudo locale-gen en_CA.UTF-8
@kiasaki
kiasaki / service_test.go
Created February 4, 2015 23:42
Go Service Tests Example
// from https://github.com/benschw/weather-go/blob/master/location/location_service_test.go
package location
import (
"fmt"
"github.com/benschw/opin-go/config"
"github.com/benschw/opin-go/rando"
"github.com/benschw/opin-go/rest"
"github.com/benschw/weather-go/location/api"
"github.com/benschw/weather-go/location/client"