Skip to content

Instantly share code, notes, and snippets.

View tagrudev's full-sized avatar

Todor Grudev tagrudev

View GitHub Profile
Divide by zero
[Thrown class java.lang.ArithmeticException]
Restarts:
0: [QUIT] Quit to the SLIME top level
Backtrace:
0: Numbers.java:156 clojure.lang.Numbers.divide
1: Numbers.java:3691 clojure.lang.Numbers.divide
2: NO_SOURCE_FILE:1 user/eval1950
@tagrudev
tagrudev / gist:4135344
Created November 23, 2012 12:09
Loads ZSH PATH env
;;; sets zsh path
(let ((path (shell-command-to-string ". ~/.zshrc; echo -n $PATH")))
(setenv "PATH" path)
(setq exec-path
(append
(split-string-and-unquote path ":")
exec-path)))
; SLIME 20100404
user> (println "Hello World")
Hello World
nil
user>
@tagrudev
tagrudev / gist:4124691
Created November 21, 2012 12:46
Create global gitignore file
create a file in your ~ dir named .gitignore_global
then:
git config --global core.excludesfile ~/.gitignore_global
add content to your .gitignore_global file
C runs the command self-insert-command, which is an interactive built-in function in `C source code'.
It is bound to many ordinary text characters.
(self-insert-command N)
C runs the command self-insert-command, which is an interactive built-in function in `C source code'.
It is bound to many ordinary text characters.
(self-insert-command N)
Insert the character you type.
Whichever character you type to run this command is inserted.
Before insertion, `expand-abbrev' is executed if the inserted character does
not have word syntax and the previous character in the buffer does.
C runs the command self-insert-command, which is an interactive built-in function in `C source code'.
It is bound to many ordinary text characters.
(self-insert-command N)
Insert the character you type.
Whichever character you type to run this command is inserted.
Before insertion, `expand-abbrev' is executed if the inserted character does
not have word syntax and the previous character in the buffer does.
Spork.each_run do
...
# Hack to ensure models get reloaded by Spork - remove as soon as this is fixed in Spork.
# Silence warnings to avoid all the 'warning: already initialized constant' messages that
# appear for constants defined in the models.
silence_warnings do
Dir["#{Rails.root}/app/models/**/*.rb"].each {|f| load f}
end
end
Spork.each_run do
require 'factory_girl_rails'
# reload all the models
Dir["#{Rails.root}/app/models/**/*.rb"].each do |model|
load model
end
end
@tagrudev
tagrudev / yolo
Last active May 13, 2017 13:51
YOLO practices #RubyOnRails
# Do not refactor, it is a bad practice. YOLO
# Not understanding why or how something works is always good. YOLO
# Do not ever test your code yourself, just ask. YOLO
# No one is going to read your code, at any point don't comment. YOLO
# Why do it the easy way when you can reinvent the wheel? Future-proofing is for pussies. YOLO