Skip to content

Instantly share code, notes, and snippets.


Gabriele Renzi riffraff

View GitHub Profile
View gist:9362785
$ otool -l ./Contents/Resources/bin/ozemulator
Load command 0
cmdsize 72
segname __PAGEZERO
vmaddr 0x0000000000000000
vmsize 0x0000000100000000
fileoff 0
filesize 0

Keybase proof

I hereby claim:

  • I am riffraff on github.
  • I am riffraff ( on keybase.
  • I have a public key whose fingerprint is 2E84 DF2D 6038 DAA0 F7D5 1B66 32BB 1A7F 22C3 BB65

To claim this, I am signing this object:

View gist:f4e63bac0ae9ef38b26f
ssh ()
SSH=$(which ssh);
CURTHEME=$(osascript -e "tell application \"Terminal\" to get the name of current settings of the selected tab of the front window");
CURTAB=$(osascript -e "tell application \"Terminal\" to get the selected tab of the front window");
osascript -e "tell application \"Terminal\" to set current settings of $CURTAB to settings set \"$REMOTE_TERMINAL_THEME_NAME\"";
$SSH "$@";
osascript -e "tell application \"Terminal\" to set current settings of $CURTAB to settings set \"$CURTHEME\""
View run-forever
#!/usr/bin/env ruby
# vim: syntax=ruby
require 'timeout'
timeout = (ENV['TIMEOUT'] || 2*60*60).to_i
def log str
puts "run-forever: #{str}"
View quiz.rb
# use a single string object as IO, enforces ordering, use srand to avoid randomness and stubbing/subclassing
class Quiz
def initialize(input = STDIN, output = STDOUT)
@input = input
@output = output
def problem
first = rand(10)
second = rand(10)
View gist:114222
//this should be builtin in 2.8
def groupBy[T](list: List[T], eq: (T,T) => Boolean ): List[List[T]] = list match {
case Nil => Nil
case x::xs => {
val (ys:List[T],zs:List[T]) = xs.span(eq(_,x));
(x::ys)::groupBy(zs, eq)
def compress3[T](list: List[T]): List[T] =
View gist:118069
<fieldtype name="parsedType" indexed="true" stored="true" compressed="true" class="solr.TextField" sortMissingLast="true">
<analyzer class="org.apache.lucene.analysis.SimpleAnalyzer"/>
<field name="name"type="parsedType" required="true" multiValued="false"/>
document.addField(NAME, name);
View gist:311023
akosma = 0.0
mph = 0.0
manuelmeurer = 0.0
alinet010 = 0.0
dbarison = 0.0
atinypixel = 0.0
mattslack = 0.0
nullobject = 0.0
fritzZz = 0.0
jyn = 0.0
View gist:335145
ERROR - Internal error processing multiget_slice
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(
at java.util.ArrayList.get(
at org.apache.cassandra.service.CassandraServer.readColumnFamily(
at org.apache.cassandra.service.CassandraServer.getSlice(
at org.apache.cassandra.service.CassandraServer.multigetSliceInternal(
at org.apache.cassandra.service.CassandraServer.multiget_slice(
at org.apache.cassandra.service.Cassandra$Processor$multiget_slice.process(
at org.apache.cassandra.service.Cassandra$Processor.process(
View gist:350453
require 'enumerator'
require 'mu'
def f (ary, size)
needed = ary.size - size
while needed > 0
result =
ary.each_slice(2) do |a,b|
if needed > 0
result << a+b