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
@zchee
zchee / .phoenix.js
Created October 22, 2015 01:31
Basic window management with Phoenix
'use strict';
var keys = [];
var controlShift = [ 'ctrl', 'shift' ];
var controlAltShift = [ 'ctrl', 'alt', 'shift' ];
var margin = 10;
var increment = 0.1;
/* Position */
@zchee
zchee / quickrun.vim
Created October 13, 2015 22:40 — forked from osyo-manga/quickrun.vim
quickrun.vim の設定
function! s:quickrun_config()
return unite#sources#quickrun_config#quickrun_config_all()
endfunction
" quickrun-runner {{{
" vimscript_all {{{
let s:runner = {}
@zchee
zchee / gist:d75e50c2284864bc1388
Created October 13, 2015 07:42 — forked from enukane/gist:3200560
WIP: host-side virtio-9p mock device
Index: usr.sbin/bhyve/Makefile
===================================================================
--- usr.sbin/bhyve/Makefile (revision 238860)
+++ usr.sbin/bhyve/Makefile (working copy)
@@ -8,6 +8,7 @@
SRCS+= instruction_emul.c mevent.c
SRCS+= pci_emul.c pci_hostbridge.c pci_passthru.c pci_virtio_block.c
SRCS+= pci_virtio_net.c pci_uart.c pit_8254.c post.c rtc.c uart.c xmsr.c
+SRCS+= pci_virtio_9p.c
@zchee
zchee / arch-xhyve.sh
Created October 12, 2015 14:54 — forked from lloeki/arch-xhyve.sh
Run Arch Linux in xhyve
#!/bin/bash
tmp=$(mktemp -d)
pushd "$tmp"
iso=/Users/lloeki/Downloads/archlinux-2015.08.01-dual.iso
echo "fixing disk"
dd if=/dev/zero bs=2k count=1 of=tmp.iso
dd if=$iso bs=2k skip=1 >> tmp.iso
echo "mounting disk"
@zchee
zchee / xcode-clang-vers
Created October 4, 2015 08:40 — forked from yamaya/xcode-clang-vers
Xcode clang version record
# Xcode 4.3.3
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
# Xcode 4.3.2
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
@zchee
zchee / xcode-cli-tools.sh
Created September 29, 2015 21:57 — forked from trinitronx/xcode-cli-tools.sh
Script to download & install XCode Command Line tools on OSX 10.7 or 10.8. Lifted from jedi4ever/veewee template.
#!/bin/sh
OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}')
# Get Xcode CLI tools
# https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/index-3905972D-B609-49CE-8D06-51ADC78E07BC.dvtdownloadableindex
TOOLS=clitools.dmg
if [ ! -f "$TOOLS" ]; then
if [ "$OSX_VERS" -eq 7 ]; then
DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg
elif [ "$OSX_VERS" -eq 8 ]; then
@zchee
zchee / build-crosscompile-env.sh
Created September 27, 2015 02:04 — forked from nikuyoshi/build-crosscompile-env.sh
Goのクロスコンパイル環境構築のためのシェルスクリプト
#!/bin/sh
# Environment list
# $GOOS $GOARCH
# darwin 386
# darwin amd64
# freebsd 386
# freebsd amd64
# freebsd arm
# linux 386
@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() {
@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 / 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