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
# Updated for Ruby 2.3 | |
string_t = None | |
def get_rstring(addr): | |
s = addr.cast(string_t.pointer()) | |
if s['basic']['flags'] & (1 << 13): | |
return s['as']['heap']['ptr'].string() | |
else: | |
return s['as']['ary'].string() |
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 'fiddle' | |
module IAmAHorriblePerson | |
def unset flag | |
value = _wrap self | |
flags = 8.times.map { |i| value[i] }.pack('C8').unpack('Q').first | |
[flags & ~flag].pack('Q').unpack('C8').each_with_index { |n,i|value[i] = n } | |
end | |
def class= k |
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
#!/bin/bash | |
if [ ! -z `git diff --name-only HEAD@{1}..HEAD Gemfile` ] | |
then | |
echo -e "\033[0;31m*** Gemfile change detected, running bundle install ***\033[0m" | |
bundle install | |
fi |