Skip to content

Instantly share code, notes, and snippets.

@sionide21
sionide21 / gist:362318
Created April 10, 2010 21:42
Finds an executable by wildcard
function find_command
{
i=1;
while [ $(echo $PATH | cut -d : -f "$i") ]; do
PATHITEM=$(echo $PATH | cut -d : -f "$i")
find $PATHITEM -name "$1"
let i="$i+1"
done
}
alias all_done="notify Config Done || notify Config Failed"
./configure && all_done
05-14 22:32:16.744: WARN/WindowManager(63): Attempted to add window with non-application token WindowToken{43ee9978 token=null}. Aborting.
05-14 22:32:16.764: WARN/dalvikvm(63): threadid=15: thread exiting with uncaught exception (group=0x4001b188)
05-14 22:32:16.764: ERROR/AndroidRuntime(63): Uncaught handler: thread android.server.ServerThread exiting due to uncaught exception
05-14 22:32:16.764: ERROR/AndroidRuntime(63): *** EXCEPTION IN SYSTEM PROCESS. System will crash.
05-14 22:32:16.794: ERROR/AndroidRuntime(63): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
05-14 22:32:16.794: ERROR/AndroidRuntime(63): at android.view.ViewRoot.setView(ViewRoot.java:472)
05-14 22:32:16.794: ERROR/AndroidRuntime(63): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
05-14 22:32:16.794: ERROR/AndroidRuntime(63): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
05-14 22:32:16.794: ERROR/AndroidRuntime(63):
$(echo $FOO)
@sionide21
sionide21 / gist:434550
Created June 11, 2010 14:40
FOO with whitespace
FOO=" Bar"
@sionide21
sionide21 / gist:434547
Created June 11, 2010 14:37
Remove leading whitespace
${FOO##*( )}
export FIGNORE=".svn"
@sionide21
sionide21 / gist:850065
Created March 1, 2011 22:49
Firefox Error
sqlite> select count(*) from moz_downloads;
Error: database disk image is malformed
@sionide21
sionide21 / test.rb
Created March 3, 2011 13:37
DNS Sample
require 'dns'
server = DNS::Server.new
server.handle_a do |query, response|
response << DNS::Record::A.new(query.name, "192.168.12.10#{rand 10}")
end
server.listen
@sionide21
sionide21 / simple_form.rb
Created January 2, 2012 16:40 — forked from seyhunak/simple_form.rb
Using simple_form and integrating Twitter Bootstrap
1. Use latest build
gem 'simple_form', :git => 'git://github.com/plataformatec/simple_form.git'
2. Create an initializer
# /config/initializers/simple_form.rb
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
# Wrappers are used by the form builder to generate a complete input.
# You can remove any component from the wrapper, change the order or even