This file contains hidden or 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
import os | |
from log_exceptions import log_exceptions | |
def throw_something(a1, a2): | |
raise Exception('Whoops!') | |
@log_exceptions(log_if = os.getenv('MYAPP_DEBUG') is not None) | |
def my_function(arg1, arg2): | |
throw_something(arg1 + 24, arg2 - 24) |
This file contains hidden or 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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Getopt::Long qw(:config no_ignore_case ); | |
my $replace = undef; | |
my $delete = undef; | |
my $help = 0; | |
GetOptions ( |
This file contains hidden or 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
/** | |
* Git Pull | |
* | |
* @author Adam Patterson | |
* http://www.adampatterson.ca/blog/2011/10/diy-simple-staging-server/ | |
* | |
* Use: echo pull(); | |
*/ | |
function pull ( ) |
This file contains hidden or 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 'sinatra' | |
require 'redis' | |
require 'json' | |
require 'date' | |
class String | |
def &(str) | |
result = '' | |
result.force_encoding("BINARY") |
This file contains hidden or 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
diff --git a/redis.conf b/redis.conf | |
index 44fb536..505cb6e 100644 | |
--- a/redis.conf | |
+++ b/redis.conf | |
@@ -150,6 +150,13 @@ slave-serve-stale-data yes | |
# | |
# repl-timeout 60 | |
+# When setting up replication, the slave will purge the current data set before | |
+# loading the data sync from the master. Setting this will prevent that from |
This file contains hidden or 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
1.) [1] [2] [3] Six node cluster | |
[4] [5] [6] | |
2.) [1] [2] <= [3] Hosts 2 and 5 replicate from 3 and 6 respectively. | |
[4] [5] <= [6] Once caught up, the clients are updated to point | |
to 2 and 5 instead, and 3 and 6 are terminated. | |
3.) [1] <= [2] Repeat. | |
[4] <= [5] |
This file contains hidden or 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
unsigned long zslGetRank(zskiplist *zsl, double score, robj *o) { | |
zskiplistNode *x; | |
unsigned long rank = 0; | |
int i; | |
x = zsl->header; | |
for (i = zsl->level-1; i >= 0; i--) { | |
while (x->level[i].forward && | |
(x->level[i].forward->score < score || | |
(x->level[i].forward->score == score && |
This file contains hidden or 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
Program received signal SIGSEGV, Segmentation fault. | |
zslGetRank (zsl=0x7f3d8d71c360, score=19.498544884710096, o=0x7f3d4cab5760) at t_zset.c:335 | |
335 (x->level[i].forward->score < score || | |
(gdb) bt | |
#0 zslGetRank (zsl=0x7f3d8d71c360, score=19.498544884710096, o=0x7f3d4cab5760) at t_zset.c:335 | |
#1 0x000000000042818b in zrankGenericCommand (c=0x7f3d9dcdc000, reverse=1) at t_zset.c:2046 | |
#2 0x00000000004108d4 in call (c=0x7f3d9dcdc000) at redis.c:1024 | |
#3 0x0000000000410c1c in processCommand (c=0x7f3d9dcdc000) at redis.c:1130 | |
#4 0x0000000000419d3f in processInputBuffer (c=0x7f3d9dcdc000) at networking.c:865 | |
#5 0x0000000000419e1c in readQueryFromClient (el=<value optimized out>, fd=<value optimized out>, privdata=0x7f3d9dcdc000, mask=<value optimized out>) at networking.c:908 |
This file contains hidden or 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
# encoding: UTF-8 | |
# dependencies: | |
# - wget http://dist.schmorp.de/liblzf/liblzf-3.6.tar.gz | |
# - gem install lzfruby | |
require 'lzfruby' | |
require 'stringio' | |
class DiskstoreInspector |
This file contains hidden or 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
source "http://rubygems.org" | |
group :development do | |
gem 'guard' | |
gem 'ruby_gntp' | |
gem 'growl' | |
end |