Skip to content

Instantly share code, notes, and snippets.

View mpapis's full-sized avatar
🙃
I am slow to respond, ping me when it's crucial.

Michal Papis mpapis

🙃
I am slow to respond, ping me when it's crucial.
View GitHub Profile
--- a/ext/readline/readline.c (revision 45251)
+++ b/ext/readline/readline.c (revision 45252)
@@ -1883,7 +1883,7 @@
rl_attempted_completion_function = readline_attempted_completion_function;
#if defined(HAVE_RL_PRE_INPUT_HOOK)
- rl_pre_input_hook = (Function *)readline_pre_input_hook;
+ rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
#endif
#ifdef HAVE_RL_CATCH_SIGNALS
#!/usr/bin/env bash
#
# Automatically sets the wrappers for textmate's use
# Based on article posted: http://www.christopherirish.com/2010/06/28/how-to-setup-textmate-to-use-rvm/
# Set up the TM_RUBY shell variable as described and remove the Builder as described and restart TextMate
#
# Make this script executable and you should be good to go! TextMate will stay in sync with rvm, which
# generally means the last project folder you switched into from terminal shell.
#
if [[ $TM_WRAPPING != "1" ]]; then
@mpapis
mpapis / template_.conf
Created May 30, 2011 14:24
templates on bdsm
a={{a}}
b={{b}}
c={{c}}
d={{d}}
e={{e}}
@mpapis
mpapis / test_f.sh
Created June 3, 2011 08:08
Issues with `command -v` on opensuse
mpapis@niczsoft:~/projects/opensource> test_f(){
> echo 'a'
> }
mpapis@niczsoft:~/projects/opensource> test_f
a
mpapis@niczsoft:~/projects/opensource> which test_f
which: no test_f in (/home/mpapis/.rvm/gems/ruby-1.9.2-p180/bin:/home/mpapis/.rvm/gems/ruby-1.9.2-p180@global/bin:/home/mpapis/.rvm/rubies/ruby-1.9.2-p180/bin:/home/mpapis/.rvm/bin:/usr/local/bdsm/pkg/active/bin:/home/mpapis/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/sbin:/usr/sbin)
mpapis@niczsoft:~/projects/opensource> type test_f | head -1
test_f is a function
mpapis@niczsoft:~/projects/opensource> command -v test_f ; echo $?
mpapis@niczsoft:~/projects/opensource/rubygems-bundler> gem build rubygems-bundler.gemspec --backtrace
ERROR: While executing gem ... (NoMethodError)
undefined method `write' for #<Syck::Emitter:0x818f710>
/home/mpapis/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `end_document'
/home/mpapis/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `visit_Psych_Nodes_Document'
/home/mpapis/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/visitors/visitor.rb:10:in `accept'
/home/mpapis/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `block in visit_Psych_Nodes_Stream'
/home/mpapis/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `each'
/home/mpapis/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `visit_Psych_Nodes_Stream'
/home/mpapis/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/visitors/visitor.rb:11:in `accept'
@mpapis
mpapis / list
Created June 21, 2011 13:56
new bdsm extensions layout
extensions/core/core/actions
extensions/core/core/modules
extensions/core/ext/actions
extensions/core/ext/modules
extensions/internal/ <- bdsm-extensions
extensions/external/backup <- github/mpapis/bdsm_backup
@mpapis
mpapis / bdsm.sh
Created June 28, 2011 01:47
bdsm external
mpapis@niczsoft:~/projects/opensource/bdsm> sudo bdsm --debug extend mpapis/bdsm_backup backup
root's password:
DEBUG: on
DEBUG: detected path:/usr/local/bdsm/extensions/builtin/core/actions/ext/extend, action:default, params:mpapis/bdsm_backup backup.
DEBUG: WTF!!! move code to actions
scm_get mpapis/bdsm_backup -> /usr/local/bdsm/src/extensions/mpapis_bdsm_backup
- backup
mpapis@niczsoft:~/projects/opensource/bdsm> bdsm list
Extensions installed in /usr/local/bdsm/extensions/external:
backup
@mpapis
mpapis / irb session
Created July 1, 2011 21:50 — forked from whartonn/irb session
passenger error
ruby-1.8.7-p334 :001 > rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
=> "/home/mpapis/.rvm"
ruby-1.8.7-p334 :002 > rvm_lib_path = File.join(rvm_path, 'lib')
=> "/home/mpapis/.rvm/lib"
ruby-1.8.7-p334 :003 > $LOAD_PATH.unshift rvm_lib_path
=> ["/home/mpapis/.rvm/lib", "/home/mpapis/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8", "/home/mpapis/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/i686-linux", "/home/mpapis/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby", "/home/mpapis/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/vendor_ruby/1.8", "/home/mpapis/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/vendor_ruby/1.8/i686-linux", "/home/mpapis/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/vendor_ruby", "/home/mpapis/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8", "/home/mpapis/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/i686-linux", "."]
ruby-1.8.7-p334 :004 > RVM.current
NameError: uninitialized constant RVM
from (irb):4
ruby-1.8.7-p334 :005 > require 'rvm'
@mpapis
mpapis / default_case.sh
Created July 19, 2011 12:14
case with default
a=''
case "${a:-n}" in
(y|yes) echo "true"
;;
(n|no) echo "false"
;;
(*) echo "else"
;;
esac