Skip to content

Instantly share code, notes, and snippets.

View cromulus's full-sized avatar

Bill Cromie cromulus

View GitHub Profile
@cromulus
cromulus / gist:c5d5e84b29ca7e47efee
Created July 7, 2014 13:49
Ethan's Ruby Warrior
class Player
attr_accessor :previous_health
def play_turn(warrior)
#warrior.walk!(:forward)
if warrior.health < 15 and warrior.feel.empty?
warrior.rest!
elsif warrior.feel.empty?
warrior.walk!(:forward)
else
warrior.attack!(:forward)
function _git_prompt() {
local git_status="`git status -unormal 2>&1`"
if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then
if [[ "$git_status" =~ nothing\ to\ commit ]]; then
local ansi=42
elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then
local ansi=43
else
local ansi=45
fi
@cromulus
cromulus / gist:5165194
Created March 14, 2013 20:56
odd strace starting a rails console in rails 2.3.17
open("/vagrant/vendor/bundle/ruby/1.9.1/gems/activesupport-2.3.17/lib/active_support/core_ext/time.rb", O_RDONLY) = 7
fstat(7, {st_mode=S_IFREG|0644, st_size=1528, ...}) = 0
ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff01c20f58) = -1 ENOTTY (Inappropriate ioctl for device)
fstat(7, {st_mode=S_IFREG|0644, st_size=1528, ...}) = 0
read(7, "require 'date'\nrequire 'time'\n\nc"..., 8192) = 1528
read(7, "", 8192) = 0
close(7) = 0
lstat("/vagrant", {st_mode=S_IFDIR|0755, st_size=1666, ...}) = 0
lstat("/vagrant/vendor", {st_mode=S_IFDIR|0755, st_size=136, ...}) = 0
lstat("/vagrant/vendor/bundle", {st_mode=S_IFDIR|0755, st_size=102, ...}) = 0
# Server
redis_version:2.5.8
redis_git_sha1:00000000
redis_git_dirty:0
os:Linux 2.6.32-41-generic x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.4.3
process_id:31562
run_id:b75f3cd07c3fb3aea33d7a9dea08dda0769ac360
May 4 16:37:13 sd08 redis[31531]: #012#012=== REDIS BUG REPORT START: Cut & paste starting from here ===
May 4 16:37:13 sd08 redis[31531]: === ASSERTION FAILED OBJECT CONTEXT ===
May 4 16:37:13 sd08 redis[31531]: Object type: 3
May 4 16:37:13 sd08 redis[31531]: Object encoding: 5
May 4 16:37:13 sd08 redis[31531]: Object refcount: 1
May 4 16:37:13 sd08 redis[31531]: Sorted set size: 129
May 4 16:37:13 sd08 redis[31531]: === ASSERTION FAILED ===
May 4 16:37:13 sd08 redis[31531]: ==> t_zset.c:767 'dictAdd(zs->dict,ele,&node->score) == DICT_OK' is not true
May 4 16:37:13 sd08 redis[31531]: (forcing SIGSEGV to print the bug report.)
May 4 16:37:13 sd08 redis[31531]: Redis 2.5.8 crashed by signal: 11
@cromulus
cromulus / elasticsearch.conf
Created February 18, 2012 05:14 — forked from rbscott/elasticsearch.conf
upstart job for elastic search
# ElasticSearch Service
description "ElasticSearch"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
@cromulus
cromulus / gist:947343
Created April 28, 2011 21:08
heatmap.js issues on chrome, getting
data={"vals":[{"x":"473","y":"13"},{"x":"473","y":"13"},{"x":"92","y":"154"},{"x":"92","y":"154"},{"x":"91","y":"135"},{"x":"91","y":"135"},{"x":"86","y":"96"},{"x":"86","y":"96"},{"x":"123","y":"75"},{"x":"123","y":"75"},{"x":"105","y":"81"},{"x":"105","y":"81"},{"x":"101","y":"82"},{"x":"101","y":"82"},{"x":"82","y":"98"},{"x":"82","y":"98"},{"x":"80","y":"107"},{"x":"80","y":"107"},{"x":"80","y":"123"},{"x":"80","y":"123"},{"x":"82","y":"169"},{"x":"82","y":"169"},{"x":"84","y":"220"},{"x":"84","y":"220"},{"x":"85","y":"226"},{"x":"85","y":"226"},{"x":"85","y":"224"},{"x":"85","y":"224"},{"x":"87","y":"167"},{"x":"87","y":"167"},{"x":"91","y":"140"},{"x":"91","y":"140"},{"x":"104","y":"103"},{"x":"104","y":"103"},{"x":"104","y":"103"},{"x":"104","y":"103"},{"x":"1177","y":"45"},{"x":"1177","y":"45"},{"x":"1177","y":"93"},{"x":"1177","y":"93"},{"x":"1184","y":"101"},{"x":"1184","y":"101"},{"x":"1222","y":"141"},{"x":"1222","y":"141"},{"x":"1237","y":"198"},{"x":"1237","y":"198"},{"x":"1173","y":"333"},{"x":
Feb 24 10:25:11 sd0 dkim-filter[5737]: 754AAE3A740 external host sd3 attempted to send as mailer.headliner.fm
Feb 24 10:25:11 sd0 postfix/smtpd[2150]: connect from sd3[10.16.243.132]
Feb 24 10:25:11 sd0 postfix/smtp[2251]: DBE7AE3A75F: to=<theendofwar@yahoo.com>, relay=g.mx.mail.yahoo.com[98.137.54.238]:25, conn_use=4, delay=0.61, delays=0.06/0/0.09/0.46, dsn=2.0.0, status=sent (250 ok dirdel)
Feb 24 10:25:11 sd0 postfix/qmgr[6423]: DBE7AE3A75F: removed
Feb 24 10:25:11 sd0 dkim-filter[5737]: 40D47E3A759 external host sd3 attempted to send as mailer.headliner.fm
Feb 24 10:25:11 sd0 postfix/smtpd[2150]: connect from sd3[10.16.243.132]
Feb 24 10:25:11 sd0 postfix/smtp[2454]: 0F8C7E3A74D: to=<ceceluvsyou@hotmail.com>, relay=mx3.hotmail.com[65.55.92.168]:25, delay=0.23, delays=0.06/0/0.1/0.07, dsn=5.0.0, status=bounced (host mx3.hotmail.com[65.55.92.168] said: 550$
Feb 24 10:25:11 sd0 postfix/smtpd[2150]: 49626E3A762: client=sd3[10.16.243.132]
Feb 24 10:25:11 sd0 postfix/cleanup[2140]: 49626E3A762: message-id=<4b8552e745190_1ca94da92c1c2@sd03.headliner.fm.tmail>
Received: by 10.213.10.67 with SMTP id o3cs162154ebo;
Tue, 23 Feb 2010 15:36:13 -0800 (PST)
Received: by 10.101.2.4 with SMTP id e4mr11483211ani.49.1266968172434;
Tue, 23 Feb 2010 15:36:12 -0800 (PST)
Return-Path: <no-reply@mailer.headliner.fm>
Received: from mailer.headliner.fm (mailer.headliner.fm [208.43.54.60])
by mx.google.com with ESMTP id 1si6761025gxk.9.2010.02.23.15.36.11;
Tue, 23 Feb 2010 15:36:12 -0800 (PST)
Received-SPF: pass (google.com: best guess record for domain of no-reply@mailer.headliner.fm designates 208.43.54.60 as permitted sender) client-ip=208.43.54.60;
Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of no-reply@mailer.headliner.fm designates 208.43.54.60 as permitted sender) smtp.mail=no-reply@mailer.headliner.fm