Skip to content

Instantly share code, notes, and snippets.

View diasjorge's full-sized avatar
🤖

Jorge Dias diasjorge

🤖
View GitHub Profile
# If you wonder why we implement this class, it's because StringInquirer has a bug
# since it inherits from String, so if you ask for all? then it always returns true
class Inquirer
def initialize(value)
@value = value.to_s
end
def method_missing(method_name, *arguments)
if method_name.to_s[-1,1] == "?"
self == method_name.to_s[0..-2]
(defun ruby-generate-tags()
(interactive)
(let ((root (ffip-project-root)))
(let ((my-tags-file (concat root "TAGS")))
(message "Regenerating TAGS file: %s" my-tags-file)
(if (file-exists-p my-tags-file)
(delete-file my-tags-file))
(shell-command
(format "find %s -iname '*.rb' | grep -v db | xargs ctags -a -e -f %s"
root my-tags-file))
@diasjorge
diasjorge / gist:1688474
Created January 27, 2012 12:00 — forked from dx7/gist:1333785
Installing ruby-debug with ruby-1.9.3-p0
# Install with:
# bash < <(curl -L https://gist.github.com/raw/1688474)
#
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
echo "Installing ruby-debug with ruby-1.9.3-p0 ..."
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
@diasjorge
diasjorge / Agenda
Created February 15, 2012 18:48
Efficient bash cheat sheet
Efficient moving
Ctrl-a Move to the start of the line.
Ctrl-e Move to the end of the line.
Ctrl-b Move back one character.
Alt-b Move back one word.
Ctrl-f Move forward one character.
Alt-f Move forward one word.
@diasjorge
diasjorge / contents
Created April 4, 2012 08:09
Emacs build pack error
cat Procfile
web: tar xzf emacs.tar.gz && ln -s $PWD/emacs /tmp/emacs; emacs/bin/emacs --daemon --load init.el
heroku ps
Process State Command
------- --------------- ------------------------------------
web.1 crashed for 51s tar xzf emacs.tar.gz && ln -s $PWD..
;;; init.el
(require 'elnode (concat load-file-name "elnode.el"))
@diasjorge
diasjorge / gist:2652738
Created May 10, 2012 12:23
elpa-package fix
diff --git a/methods/el-get-elpa.el b/methods/el-get-elpa.el
index 02cb694..296c1ed 100644
--- a/methods/el-get-elpa.el
+++ b/methods/el-get-elpa.el
@@ -30,11 +30,10 @@
PACKAGE isn't currently installed by ELPA."
(when (package-installed-p package)
(let ((package-name (el-get-as-string package))
- (package-version (package-desc-vers (assq package package-alist))))
+ (package-version (package-desc-vers (cdr (assq package package-alist)))))
@diasjorge
diasjorge / gist:2702302
Created May 15, 2012 14:43
Working dir completion
xing_dir="/Users/jorge.dias/development/xing"
function cx () {
if [ -n $1 ]; then
cd "$xing_dir/$1"
else
cd $xing_dir
fi
}
# Does not work because of a broken symlink in the dmg
#dropbox:
# package: Dropbox
# volume_dir: Dropbox Installer
# url: "http://www.dropbox.com/download?plat=mac"
chrome:
package: "Google Chrome"
url: "https://dl-ssl.google.com/chrome/mac/stable/GGRM/googlechrome.dmg"
@diasjorge
diasjorge / ruby-mode.el
Created July 6, 2012 07:13
Modified ruby-mode
;;; ruby-mode.el --- Major mode for editing Ruby files
;; Copyright (C) 1994-2008 Yukihiro Matsumoto, Nobuyoshi Nakada
;; Authors: Yukihiro Matsumoto, Nobuyoshi Nakada
;; URL: http://www.emacswiki.org/cgi-bin/wiki/RubyMode
;; Created: Fri Feb 4 14:49:13 JST 1994
;; Keywords: languages ruby
;; Version: 1.1
@diasjorge
diasjorge / xing.sh
Created July 18, 2012 07:26
xing.sh
complete -C `which xing_autocompletion` -o default xing
xing_dir="/Users/jorge.dias/development/xing"
function cx () {
if [ -n $1 ]; then
cd "$xing_dir/$1"
else
cd $xing_dir
fi