Skip to content

Instantly share code, notes, and snippets.

View mceachen's full-sized avatar

Matthew McEachen mceachen

View GitHub Profile
@Gedrovits
Gedrovits / how-to-fix-on-mac.sh
Last active May 3, 2018 21:50
How to fix 'dyld: lazy symbol binding failed: Symbol not found: _yajl_set_static_value'
# Copy the gem location to clipboard
bundle show yajl-ruby | pbcopy
# Example: /Users/gedrovits/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/yajl-ruby-0.8.2
cd <cmd + v>
cd ext/yajl
# Now we need to replace 'inline void' to 'static void'. This will also create backup of old files.
sed -i '.bak' 's/inline void/static void/g' yajl_ext.h yajl_ext.c
# Now we must rebuild changed extension
make clean all
# After this you should not have any problems with yajl-ruby
@benbuckman
benbuckman / intercept-stdout.js
Created May 20, 2012 15:42 — forked from pguillory/gist:729616
Hooking into Node.js stdout, pipe stdout to telnet
var _ = require('underscore'),
util = require('util');
// intercept stdout, passes thru callback
// also pass console.error thru stdout so it goes to callback too
// (stdout.write and stderr.write are both refs to the same stream.write function)
// returns an unhook() function, call when done intercepting
module.exports = function interceptStdout(callback) {
var old_stdout_write = process.stdout.write,
old_console_error = console.error;
@ryangreenberg
ryangreenberg / gist:2722492
Last active October 5, 2015 00:18
pid roulette
ps axc -o pid | grep -v PID | ruby -e 'puts STDIN.read.split("\n").shuffle.join("\n")' | head -1 | xargs kill
@ryangreenberg
ryangreenberg / gist:1199301
Created September 6, 2011 23:35
self.destruct!
#!/usr/bin/env ruby -wKU
class Object
def destruct!
print "This message will self-destruct in..."
5.downto(0) {|i| print "#{i}..."; $stdout.flush; sleep(1)}
File.open(__FILE__, 'w') { }
end
end
@javan
javan / gist:1168475
Created August 24, 2011 16:32
Fix iPhone home button
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/
1.) Open any application
2.) Press and hold the power button until the slide to shutdown swipe bar appears.
3.) Release Power button
4.) Press and hold Home button Lightly
until screen returns to icon screen
@fbuchinger
fbuchinger / .picasa.ini
Created July 9, 2011 18:26
.picasa.ini decoded
#==============================================================
# .picasa.ini FILE STRUCTURE
#
# reverse-engineered by Franz Buchinger <fbuchinger@gmail.com>
# licensed to the public domain
#
# Picasa Version(s): 3.8.0
#
# Changelog:
# v0.1: initial release