Skip to content

Instantly share code, notes, and snippets.

View kirk91's full-sized avatar
🎯
Focusing

kirk kirk91

🎯
Focusing
View GitHub Profile
@kirk91
kirk91 / introrx.md
Last active August 29, 2015 14:24 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@kirk91
kirk91 / auto_ss_link.py
Last active August 26, 2015 11:17
Auto get ss-link shadowsocks free accounts
# encoding: utf-8
from sqlalchemy import func
from moses.models import (
DBSession,
Application,
Provider,
DeviceToken,
TaskProcess,
# encoding: utf-8
import logging
import hashlib
import json
from aliyunsdkcore.client import AcsClient
from aliyunsdkcf.request.v20151127 import AuthenticateRequest
from rumble import settings
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer
// object, creating another object (Reader or Writer) that also implements
// the interface but provides buffering and some help for textual I/O.
package bufio
import (
#! /usr/bin/env bash
# emulate network latency in etcd cluster.
# set 30ms delay before sending packet that comes from source port 2380
sudo tc qdisc add dev eth0 root handle 1: htb default 1
sudo tc class add dev eth0 parent 1: classid 1:1 htb rate 1000kbps
sudo tc class add dev eth0 parent 1: classid 1:2 htb rate 1000kbps
sudo tc qdisc add dev eth0 parent 1:2 handle 10: netem delay 30ms
sudo tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip sport 2380 0xffff flowid 1:2
#! /usr/bin/env bash
# cancel packet delay
sudo tc qdisc del dev eth0 parent 1:2
sudo tc qdisc del dev eth0 root
@kirk91
kirk91 / tmux_cheatsheet.markdown
Created December 28, 2016 03:14 — forked from henrik/tmux_cheatsheet.markdown
tmux cheatsheet

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

package main
import (
"context"
"flag"
"fmt"
"log"
"runtime"
"strings"
"time"
@kirk91
kirk91 / .gitconfig
Created February 7, 2018 16:04 — forked from huytd/.gitconfig
Use neovim as diff tool
[merge]
tool = vimdiff
[mergetool]
prompt = true
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[difftool]
prompt = false
[diff]
tool = vimdiff