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 / 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 / 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 / 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 / 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 / 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 / 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 / .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 / Readme
Created October 25, 2015 07:20
Run godoc at all times
This launchd plist file will run godoc all the time on port 6060.
To have launchd start godoc at login, put godoc.plist in ~/Library/LaunchAgents:
curl -L https://gist.github.com/kr/3de40737f0e2c50b3b3a/raw/godoc.plist |
sed s:YOUR_GODOC_HERE:`which godoc`: |
sed s:YOUR_GOPATH_HERE:$GOPATH: \
>~/Library/LaunchAgents/godoc.plist
Then to load godoc right away:
launchctl load ~/Library/LaunchAgents/godoc.plist
@zchee
zchee / gist:37f718b2232511d8e3f2
Created November 12, 2015 22:36 — forked from paulfryzel/gist:3947535
like gofmt but for c... and using astyle
#!/usr/bin/env bash
# mostly from http://word.bitly.com/post/31921713978/static-analysis
function cfmt {
if [[ $# -ne 1 ]]; then
echo "Usage: cfmt <file>"
else
astyle \
--style=1tbs \
--lineend=linux \
--convert-tabs \
@zchee
zchee / mallocparallel_test.go
Created November 12, 2015 22:40 — forked from awreece/mallocparallel_test.go
Parallel Malloc Test for Go
// +build ignore
// malloc test for false sharing
package main
import (
"flag"
"runtime"