Skip to content

Instantly share code, notes, and snippets.

@dekokun
dekokun / url_hinter.diff
Created September 4, 2015 01:40
URL hinter動くように
--- url_hinter.rb 2015-09-04 10:39:08.000000000 +0900
+++ url_hinter.rb.bak 2015-09-04 10:38:52.000000000 +0900
@@ -359,10 +359,10 @@
end
def has_url?
- !/https?:\/\/[^  \(\)\r\n]*/.match(remove_color_message).nil?
+ !/https?:\/\/[^  \(\)\r\n]*/.match(remove_color_message.force_encoding("UTF-8")).nil?
end
@yutori
yutori / redis_cluster.md
Last active April 20, 2019 23:17
Redis Cluster のリシャーディングとorphaned masterの話 - CyberAgent エンジニア Advent Calendar 2014 2日目

Redis Cluster のリシャーディングとorphaned masterの話

(2019/04 追記 こちらの情報は非常に古く、またRC版での結果となります。記録として残していますが参考になさらないでください

CyberAgent エンジニア Advent Calendar 2014 2日目です。

昨日に引き続き、秋葉原ラボの柿島が担当します。仕事ではHadoopクラスタの運用を中心に、秋葉原ラボのインフラ/ミドルウェアまわりを担当しています。今年はHadoop、mesos、Aerospikeと分散型のシステムを触る機会が多い1年でした。

この記事のテーマはRedis Clusterです。Redis Clusterが使えるようになるRedis 3.0.0は10月にRC1がリリースされました。2015年のQ1にstableリリースを目指しているようです。

@Cside
Cside / repl.rc
Created November 13, 2012 14:16
~/.re.pl/repl.rc
#!perl
=pod
Original rc file is https://gist.github.com/3fb14d60757e29f8ef13.
ttakezawa++
=cut
use strict;
use warnings;
use Term::ANSIColor;
@dekokun
dekokun / log_output.sh
Created August 6, 2012 10:02
ログ関数はこんな感じがいいのかなぁ。
function log_output(){
local LEVEL=$1
shift
local MESSAGE=$@
echo `date '+%Y/%m/%d/%H:%M:%S'` `hostname` `basename $0` $$ \($LEVEL\) $MESSAGE
}
@voluntas
voluntas / gist:73efe2f36ac1513c02a8
Created August 5, 2012 16:13
レビューのススメ?

レビューのススメ?

typo 死ぬほど多いので突っ込みまってます

バージョン

0.2.3

作者

@voluntas

考え方はコロコロ変わるタイプなのですが、最近はレビューが実はとても大事でとにもかくにもレビューなのでは?と思い始めてきています。

> perl -E 'say "生" & "死"'
生 Life U+751F \xe7\x94\x9f 11100111 10010100 10011111
死 Death U+6B7B \xe6\xad\xbb 11100110 10101101 10111011
愛 Love u+611B \xe6\x84\x9b 11100110 10000100 10011011
@imathis
imathis / gist:1104557
Created July 25, 2011 16:49
FIX for Lion's posix_spawn_ext.bundle: [BUG] Segmentation fault

The segfault problem with posix_spawn is indeed caused by Lion's compiler being LLVM and not GCC by default. However, when I installed RVM, the notes suggested that on Lion you need to add export CC=/usr/bin/gcc-4.2 to your shell startup file (.bashrc or .zshrc as appropriate). I did that, but it seems that's what caused problems: while ruby 1.9.2 needs you to use GCC to install it, using the same compiler for the gems apparently causes breakage.

First, you need to install XCode 4.x, which is now a free (though hefty!) download from the Mac App Store. Without that, you have no gcc, so you won't get anywhere ;-)

Next, what you need to do is clear out your rvm ruby and the associated gems (make sure you are cd'd into your octopress repository then do:

rvm remove ruby-1.9.2 --gems --archive

which will clear everything out so that you can start from scratch. Obviously, if you have other stuff you've installed for other purposes using RVM, be careful with this. If you previously had the export CC li