Skip to content

Instantly share code, notes, and snippets.

View tagrudev's full-sized avatar

Todor Grudev tagrudev

View GitHub Profile
@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
; SLIME 20100404
user> (println "Hello World")
Hello World
nil
user>
@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)))
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
class Docushin::CollectionsController < ActionController::Base
layout 'docushin'
def index
@content = File.read(File.join(Rails.root, "doc", "docushin", "collections.yml")) rescue []
@sets = @content.nil? ? nil : YAML.load(@content)
end
end
describe 'update markdown file' do
it 'should update specified attributes' do
route.save
route.updated_at.should == File.mtime(File.join(route.base, "#{route.file_name}.md")).to_i
end
end
module ApplicationHelper
def cp(*paths)
paths.each do |path|
#do something
end
end
end
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../spec/dummy/config/environment", __FILE__)
require 'rubygems'
require 'bundler/setup'
require 'docushin'
require 'pry'
@tagrudev
tagrudev / gist:4215517
Created December 5, 2012 13:29
Where does this !binary comes from
[3] pry(#<Docushin::CollectionsController>)> @data[:id]
=> "4d696868a047e668b491fb43aebd2fc4"
[4] pry(#<Docushin::CollectionsController>)> @data[:id].to_yaml
=> "--- !binary |-\n NGQ2OTY4NjhhMDQ3ZTY2OGI0OTFmYjQzYWViZDJmYzQ=\n"
@tagrudev
tagrudev / gist:4215549
Created December 5, 2012 13:35
Check this out
[1] pry(#<Docushin::CollectionsController>)> @data[:id].class
=> String
[2] pry(#<Docushin::CollectionsController>)> @data[:id]
=> "9c52e7c86961d940906a65663d3649dc"
[4] pry(#<Docushin::CollectionsController>)> @data[:id].to_yaml
=> "--- 9c52e7c86961d940906a65663d3649dc\n...\n"
[5] pry(#<Docushin::CollectionsController>)> @data[:id].to_yaml
=> "--- !binary |-\n OWM1MmU3Yzg2OTYxZDk0MDkwNmE2NTY2M2QzNjQ5ZGM=\n"
[6] pry(#<Docushin::CollectionsController>)>