% brew install memcached
==> Installing memcached dependency: libevent
==> Downloading https://github.com/downloads/libevent/libevent/libevent-2.0.18-stable.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/libevent/2.0.18
==> make
==> make install
/usr/local/Cellar/libevent/2.0.18: 48 files, 1.8M, built in 37 seconds
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
# これで gitconfig に alias を書けばよい | |
git branch --no-color --merged 2> /dev/null | grep -v -e '*' -e master | xargs git branch -d |
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
zcat public/sitemap1.xml.gz | ruby -anle 'puts $_.gsub("<url>", "#").gsub(/[^#]*/, "").length' |
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
BRIDGE_SIZE = 6 | |
class Amida | |
def initialize(size) | |
@answer = rand(size) | |
@cols = create_cols(size) | |
@cells = create_cells(10, size) | |
(10 * size/2).times { add_bridge } | |
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
require 'test/unit' | |
require 'rubygems' | |
require 'active_support/all' | |
class EnglishNumeral | |
MAP1 = [ | |
nil, 'one', 'two', 'three', 'four', 'fice', 'six', 'seven', 'eight', 'nine', | |
'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen' | |
] | |
MAP2 = [ |
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
http { | |
... | |
server { | |
listen 8080; | |
server_name localhost; | |
# | |
# Set User Agent type | |
# | |
set $ua_type "pc"; |
brew のメンテナンス(Error: Your Homebrew is outdated)
brew doctor で出るエラーを解決する。
➜ brew doctor
:
Error: Your Homebrew is outdated
You haven't updated for at least 24 hours, this is a long time in brewland!
:
Puts loc entry in sitemap_index.xml.gz
##
# Usage: puts_locs `file`
# Puts loc entry in sitemap_index.xml.gz
#
function _puts_locs() {
zcat $1 | \
ruby -anle '$_.sub(/^.*?/, "").gsub(//, "\n").split("\n").each{|l| puts l.sub(/<\/loc>.*$/, "") }'
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
# Check JAN(Japanse Area Number) is valid or not | |
class JanCheck | |
def self.valid?(number) | |
new(number).valid? | |
end | |
attr_reader :number | |
def initialize(number) | |
@number = number.to_s |
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
sudo netstat -ntulp | grep -v '127.0.0.1:' | egrep '(tcp|udp)' | ruby -anle 'print $_ + "\t" + open("/proc/#{$_.match(/ (\d+)\//)[1]}/cmdline", "r").gets' |
OlderNewer