Skip to content

Instantly share code, notes, and snippets.

View liubin's full-sized avatar

Bin Liu liubin

View GitHub Profile
@liubin
liubin / post-commit.sh
Last active December 20, 2016 01:29
git commit messages to bearychat
#!/bin/bash
# How to use:
# export ENV_BEARYCHAT_URL=YOUR_BEARYCHAT_CHANNEL
# $ cp thisfile .git/hook/post-commit
commitid=$(git log -1 --pretty=format:"%h" --branches)
commitmessage=$(git log -1 --pretty=format:"%s" --branches)
committer=$(git log -1 --pretty=format:"%an" --branches)
from datadog import statsd
import time
from random import randint
from datadog.api.constants import CheckStatus
import threading
def increment():
while True:
s = randint(30,100)
time.sleep(s)
@liubin
liubin / cltools.sh
Created December 13, 2016 15:44 — forked from justinbellamy/cltools.sh
Install Autoconf and Automake on OS X El Capitan
#!/bin/sh
##
# Install autoconf, automake and libtool smoothly on Mac OS X.
# Newer versions of these libraries are available and may work better on OS X
#
# This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html
#
export build=~/devtools # or wherever you'd like to build
package main
import (
"encoding/json"
"fmt"
"github.com/koron/go-dproxy"
)
func main() {
var v interface{}

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@liubin
liubin / deploy.rb
Last active August 29, 2015 14:18 — forked from wlangstroth/deploy.rb
require 'bundler/capistrano'
set :application, "net"
set :repository, "[email protected]:net.git"
set :scm, :git
set :default_environment, {
'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
}
@liubin
liubin / gist:876baa4d7953ee4a9615
Last active August 29, 2015 14:17
RMagick test
# encoding: utf-8
require 'rubygems'
require 'RMagick'
def test(f)
image = Magick::ImageList.new(f)
width = image.columns
height = image.rows
#!/usr/bin/env ruby
# Colorize string
class String
def colorize(color_code)
"\e[#{color_code}m#{self}\e[0m"
end
end
class Colors