% 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
# 結論 | |
# | |
# ContentTag >>>>> Inline Erb >> Inline HAML | |
# | |
# 可読性とパフォーマンスのどちらを取りたいか考えて選択しましょう | |
# | |
# | |
# Inline HAML | |
# |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
# Fill with nil, until list will be the size. | |
# | |
# [:a].nilfil(4) #=> [:a, nil, nil, nil, nil] | |
# [:a,:b,:b,:d,:e].nilfil(4) #=> [:a, :b, :b, :d, :e] | |
class Array | |
def nilfil(size) | |
me = self.dup | |
me[size - 1] = me[size - 1] | |
me |
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
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>.*$/, "") }'
OlderNewer