This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function peco_select_history() { | |
local tac | |
if which tac > /dev/null; then | |
tac="tac" | |
else | |
tac="tail -r" | |
fi | |
BUFFER=$(fc -l -n 1 | eval $tac | peco --query "$LBUFFER") | |
CURSOR=$#BUFFER # move cursor | |
zle -R -c # refresh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main(){ | |
fmt.Println("Hello World !!!") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative "calc" | |
describe Calc do | |
describe '#sum' do | |
it 'add two numbers' do | |
subject.sum(2, 8).should == 10 | |
subject.sum(-12, 5).should == -7 | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
require "open-uri" | |
require "rss" | |
require "twitter" | |
RSS_URI = "http://weather.livedoor.com/forecast/rss/3.xml" | |
chklist = "水戸|宇都宮|前橋|さいたま|千葉|東京|横浜|甲府" | |
Twitter.configure do |cnf| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.1 | |
--- | |
$gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2/libxml --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib | |
Fetching: nokogiri-1.6.0.gem (100%) | |
Building native extensions with: '--with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2/libxml --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib' | |
This could take a while... | |
Successfully installed nokogiri-1.6.0 | |
1 gem installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd ~/.rbenv | |
$ git pull origin master | |
$ cd ~/.rbenv/plugins/ruby-build | |
$ git pull origin master | |
$ rbenv install --list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd /usr/local | |
$ git remote add origin git://github.com/mxcl/homebrew.git | |
$ git fetch origin | |
$ git reset --hard origin/master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2/libxml --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def http(request) | |
env = ENV['http_proxy'] | |
if env then | |
uri = URI(env) | |
proxy_host, proxy_port = uri.host, uri.port | |
else | |
proxy_host, proxy_port = nil, nil | |
end | |
connection = Net::HTTP::Proxy(proxy_host, proxy_port).new("api.github.com", 443) | |
connection.use_ssl = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
require 'nokogiri' | |
require 'open-uri' | |
require 'pp' | |
module GithubRuby | |
BASE_URL = "https://github.com/languages/Ruby" |
NewerOlder