Skip to content

Instantly share code, notes, and snippets.

View goldeneggg's full-sized avatar

Fuminori Sakamoto goldeneggg

  • 合同会社Practa/Practa, Inc.(Founder)
  • Japan
  • X @practainc
View GitHub Profile
@goldeneggg
goldeneggg / gontainer.sh
Created September 30, 2014 09:13
wrapper script for official docker container for golang
#!/bin/sh
usage() {
cat << __EOT__
Usage: $0 [-br] <app go package path>
Run official golang docker container
Options:
-b | --build run container and build go app
-m | --make run build by make
@goldeneggg
goldeneggg / screen-tmux.md
Created October 22, 2014 07:56
Screen vs Tmux
@goldeneggg
goldeneggg / main_irc2.go
Created November 11, 2014 10:04
simple irc client test for go
// +build main_irc2
package main
import (
"bufio"
"fmt"
"net"
"net/textproto"
package main
import "fmt"
//
// 型TがインタフェースIを実装している事を保証する実装例
//
type Nigiri interface {
Press()
@goldeneggg
goldeneggg / cross_build_go_droneio.sh
Last active August 29, 2015 14:10
Cross build script for Go project on drone.io (using godep). "Artifacts" setting on drone.io must be set "artifacts/bin/*/*"
BINNAME=YOUR_APP_NAME
export GO_VERSION=1.3.3
pushd ~
wget -q https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz
tar zxf go${GO_VERSION}.linux-amd64.tar.gz
popd
export GOROOT=~/go
@goldeneggg
goldeneggg / bash_irc.sh
Created December 11, 2014 02:35
bash組込機能である /dev/tcp を使ってnetcat風の通信処理を行うサンプル(IRC)
#!/bin/bash
-
##########################################################
# IRCにJOINするサンプル
NICK="YOUR_NICK"
SERVER="YOUR_SERVER"
CHANNEL="YOUR_CHANNEL"
PORT=6667
@goldeneggg
goldeneggg / Vagrantfile
Last active August 29, 2015 14:11
template of Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
# config
$docker_port = 4243
$go_version = "1.4"
package main
import (
"fmt"
"os"
"time"
"github.com/gdamore/mangos"
"github.com/gdamore/mangos/protocol/pub"
"github.com/gdamore/mangos/protocol/sub"
@goldeneggg
goldeneggg / color.sh
Created February 25, 2015 04:00
256色確認
#!/bin/sh
# fg
for i in {0..255} ; do
printf "\x1b[38;05;${i}mcolor${i}\n"
done
echo ''
# bg
for i in {0..255} ; do