Skip to content

Instantly share code, notes, and snippets.

View zchee's full-sized avatar
😩
want to Go knowledge...

Koichi Shiraishi zchee

😩
want to Go knowledge...
View GitHub Profile
#!/bin/sh
if [ "$1" = "open" ]; then
REPO=`git remote -v | grep origin | perl -nle '/github\.com:(\S*)\.git/ && print $1' | head -1`
open "https://travis-ci.org/$REPO"
exit
fi
rbenv exec travis "$@"
@zchee
zchee / file1.markdown
Last active August 29, 2015 14:26 — forked from hetima/file1.markdown
How to transition from EasySIMBL to SIMBL

#How to transition from EasySIMBL to SIMBL

( ~ is your home directory )

  1. Launch EasySIMBL.app. Turn OFF Use SIMBL checkbox. Quit EasySIMBL.
  2. Remove ~/Library/ScriptingAdditions/EasySIMBL.osax if exists.
  3. SIMBL directory and EasySIMBL.osax located in ~/Library/Containers/ is not needed. Find from Finder or find command like find ~/Library/Containers -name "*SIMBL*" -ls and remove manually if exists.
  4. Restart Mac (just in case).
  5. Install SIMBL-0.9.9 (original SIMBL-0.9.9.pkg is not code signed. So open from context menu)
  6. Done.
@zchee
zchee / tmux.conf
Last active August 29, 2015 14:27 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@zchee
zchee / SSHwithgit2go.go
Last active March 10, 2023 18:29 — forked from xorpaul/SSHwithgit2go.go
Working example with SSH and libgit2/git2go
package main
import (
git "github.com/libgit2/git2go"
"log"
)
func credentialsCallback(url string, username string, allowedTypes git.CredType) (git.ErrorCode, *git.Cred) {
ret, cred := git.NewCredSshKey("git", "/home/vagrant/.ssh/id_rsa.pub", "/home/vagrant/.ssh/id_rsa", "")
return git.ErrorCode(ret), &cred
@zchee
zchee / osx_kernel_debug_two_boxes.md
Last active August 27, 2015 12:20
Two-box osx kernel debugging

Two-box osx kernel development

This is an officially unsupported two-box setup, suitable for real kernel (and sometimes kext) development.

Target box setup w/ development kernel

Make sure the box has plenty, but not too much, ram, unless you enjoy wasting time doing either virtual or actual paging.

@zchee
zchee / parallelrun.py
Last active August 27, 2015 17:39 — forked from mtorromeo/parallelrun.py
Parallelize shell processes enforcing a concurrency limit using python3 and asyncio
import asyncio
concurrency_sem = asyncio.Semaphore(3)
@asyncio.coroutine
def run(process):
yield from concurrency_sem.acquire()
print("Running {}...".format(process))
proc = yield from asyncio.create_subprocess_shell(process)
yield from proc.communicate()
@zchee
zchee / iterm2-left-right-margin.diff
Last active September 14, 2015 02:20 — forked from saitoha/iterm2-left-right-margin.diff
Add DECLRMM(DECVSSM) and DECSLRM feature to iTerm2 (on progress)
diff --git a/VT100Screen.h b/VT100Screen.h
index d47185e..585d326 100644
--- a/VT100Screen.h
+++ b/VT100Screen.h
@@ -87,6 +87,8 @@ void TranslateCharacterSet(screen_char_t *s, int len);
int ALT_SAVE_CURSOR_Y;
int SCROLL_TOP;
int SCROLL_BOTTOM;
+ int SCROLL_LEFT;
+ int SCROLL_RIGHT;
@zchee
zchee / test.c
Last active September 16, 2015 09:01 — forked from nanoant/test.c
Parallels for Mac 7 having problem with ICC AVX optimized code
/*
Now let's try compile and benchmark it:
$ icc -v
icc version 13.0.0 (gcc version 4.6.0 compatibility)
Let's try without AVX set (just up to SSE4.2):
$ icc -march=corei7 test.c -lm && time ./a.out
r=171828183.102
@zchee
zchee / daemon.go
Last active August 29, 2017 23:21 — forked from wofeiwo/gist:3634357
Golang daemonize
/* ivan(a.t)mysqlab.net */
package main
import (
"syscall"
"os"
"log"
)
func daemon(nochdir, noclose int) int {
@zchee
zchee / signal.go
Last active September 21, 2015 12:27 — forked from reiki4040/signal.go
signal handling example for golang
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {