Skip to content

Instantly share code, notes, and snippets.

View liubin's full-sized avatar

Bin Liu liubin

View GitHub Profile
@liubin
liubin / cookie.go
Created June 4, 2013 12:44
display cookie in go lang
require 'google/api_client'
class GcalendarController < ApplicationController
before_filter :setup
def events
# 取得 calendar API的service
@calendar = @client.discovered_api('calendar', 'v3')
public void loop() throws java.io.IOException,
java.lang.InterruptedException {
ConnectionFactory factory = new ConnectionFactory();
factory.setHost("192.168.11.232");
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();
QueueingConsumer consumer = new QueueingConsumer(channel);
channel.basicConsume(QUEUE_NAME, true, consumer);
@liubin
liubin / index.html
Last active December 31, 2015 06:19
<a id="content-menu" class="tiny button secondary radius" href="#remote-content-menu">Show Menu</a>
<div id="remote-content-menu" style="display: none; left: 0px;">
<ul>
<li style="padding-left: 10px;"><i onclick="em()" id="hide-left-menu-icon" class="icon-arrow_left icon2x"></i></li>
<li><a href="#">Sample link 1</a></li>
<li>
<a href="#">Sample link 2</a>
<ul>
<li><a href="#">Child link 1</a></li>
@liubin
liubin / ss.rb
Last active January 1, 2016 12:49
download slide images from slideshare.net to a local folder. Without exception check.
require 'hpricot'
require 'open-uri'
require 'fileutils'
# usage:
# ruby ss.rb SLIDESHARE.NET/XXX/YYY/ZZZ
folder = ARGV[0].split('/').last
FileUtils.mkdir folder

Untitled Slide

Welcome to Glide.

Glide is the easiest way to create useful slide for all of your Gists.

  • input key <- to go backward.
  • input key -> to go forward.

Publishing

@liubin
liubin / chain.go
Last active August 29, 2015 13:56
Go Routine Test
package main
import (
"fmt"
"time"
"runtime"
)
func f(left, right chan int) { left <- 1+<-right }

Docker 虎の巻

何故Dockerを使うべきか

Why Should I Care (For Developers)

"Dockerが面白いのはシンプルな環境に隔離性と再現性をもたらしてくれることだ.ランタイムの環境を一度作れば、パッケージにして別のマシンでも再利用することできる.さらに,すべてはホスト内の隔離された環境で行われる(VMのように).最も素晴らしい点は,シンプルかつ高速であることだ."

@liubin
liubin / file0.txt
Created July 18, 2014 16:24
またThe Ruby openssl extension was not compiled. Missing the OpenSSL lib?かよ ref: http://qiita.com/liubin0329/items/6587ca86e5ff09ee3df5
Cloning https://github.com/ruby/ruby.git...
Installing ruby-2.2.0-dev...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/0n/18bwv5x16t7gy319d5wbn9480000gn/T/ruby-build.20140718233658.48380
Results logged to /var/folders/0n/18bwv5x16t7gy319d5wbn9480000gn/T/ruby-build.20140718233658.48380.log
Last 10 log lines:
bigdecimal 1.2.5
@liubin
liubin / file0.txt
Created September 15, 2014 10:36
Install Nginx(1.6.1)/PHP(5.6.0)/PHP-FPM/Redis(2.8.13)/MariaDB(10.1) on CentOS 7 ref: http://qiita.com/liubin/items/1386ba4f0bbd64d14cc5
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-1.noarch.rpm