Skip to content

Instantly share code, notes, and snippets.

View tonini's full-sized avatar
💭
I may be slow to respond.

Samuel Tonini tonini

💭
I may be slow to respond.
View GitHub Profile
git rev-parse --show-toplevel
@tonini
tonini / rake.rb
Last active December 19, 2015 08:49
# Display the tasks and comments.
# rake -D => :describe
# rake -T => :tasks
def display_tasks_and_comments
displayable_tasks = tasks.select { |t|
(options.show_all_tasks || t.comment) &&
t.name =~ options.show_task_pattern
}
case options.show_tasks
# git-submodule-deinit
deinit
Unregister the given submodules, i.e. remove the whole submodule.$name section
from .git/config together with their work tree. Further calls to git submodule
update, git submodule foreach and git submodule sync will skip any unregistered
submodules until they are initialized again, so use this command if you don't
want to have a local checkout of the submodule in your work tree anymore. If
you really want to remove a submodule from the repository and commit that use
git-rm(1) instead.
mix # ....
mix archive # Archive this project into a .ez file
mix clean # Clean generated application files
...
;; gitconfig-get-local-varibales
;; gitconfig-get-local-variable
;; gitconfig-get-global-variables
;; gitconfig-get-global-variable
;; gitconfig-get-system-varibales
;; gitconfig-get-system-variable
;; gitconfig-get-variables-from-file
Debugger entered--Lisp error: (wrong-type-argument listp 769)
memq(&rest 769)
(if (memq (quote &rest) arglist) most-positive-fixnum (length (remq (quote &optional) arglist)))
(let ((arglist (if (byte-code-function-p function) (aref function 0) (second function)))) (if (memq (quote &rest) arglist) most-positive-fixnum (length (remq (quote &optional) arglist))))
(if (subrp function) (let ((max (cdr (subr-arity function)))) (if (eq (quote many) max) most-positive-fixnum max)) (if (eq (quote macro) (car-safe function)) (setq function (cdr function))) (let ((arglist (if (byte-code-function-p function) (aref function 0) (second function)))) (if (memq (quote &rest) arglist) most-positive-fixnum (length (remq (quote &optional) arglist)))))
magit-max-args-internal(delete-directory)
(>= (magit-max-args-internal (quote delete-directory)) 2)
(if (>= (magit-max-args-internal (quote delete-directory)) 2) (defalias (quote magit-delete-directory) (quote delete-directory)) (defun magit-delete-directory (director
(defun cabbage-run-single-ruby-file (filename)
(compile (format "%s %s" ruby-compilation-executable filename)))
# erlang-r16 alreay installed
# Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
$ brew install elixir
sh: erl: command not found
elixir: Erlang R16 is required to install.
You can install this with:
brew tap homebrew/versions
tonini:git_reset_hard(master) $ git log
* f458ee5 (HEAD, master) add another file [Samuel Tonini] [14 seconds ago]
* 5e94340 just a file [Samuel Tonini] [69 seconds ago]
tonini:git_reset_hard(master) $ git reset --hard head^
HEAD is now at 5e94340 just a file
tonini:git_reset_hard(master) $ git reflog show
5e94340 HEAD@{0}: reset: moving to head^
f458ee5 HEAD@{1}: commit: add another file
#!/usr/bin/env ruby
require 'prawn'
class CabbageCheatSheet
EMACS_KEY_REGEX = /\".+\"|\[.+\]/
EMACS_FUNCTION_REGEX = /'(.+)$/
EMACS_KEYSTROKE_REGEX = /cabbage-global-set-key/