This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Give me some Clojure: | |
> (empty? nil) | |
true | |
> nil | |
nil | |
> (nil? "") | |
false | |
> (empty? "") | |
true | |
> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'ambitions spec' do | |
it 'should return true only the first time #YOLO' do | |
death.should be_true | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
Lets say we have YoloFont.otf | |
1. We add it to vendor/assets/fonts/ folder | |
2. Me personaly creates a file named fonts.css.scss in app/assets/stylesheets | |
In it I have | |
@font-face{ | |
font-family: 'YoloFont'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_model_name(item) | |
item.class.to_s == Car.to_s ? item.content.class.to_s : item.class.to_s | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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>)> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[3] pry(#<Docushin::CollectionsController>)> @data[:id] | |
=> "4d696868a047e668b491fb43aebd2fc4" | |
[4] pry(#<Docushin::CollectionsController>)> @data[:id].to_yaml | |
=> "--- !binary |-\n NGQ2OTY4NjhhMDQ3ZTY2OGI0OTFmYjQzYWViZDJmYzQ=\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
def cp(*paths) | |
paths.each do |path| | |
#do something | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |