This file contains 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
# iTerm2, OS X | |
# 1. change 'your_app_production' to your application name | |
# 1a. Tune the colors by your taste | |
# 2. put these functions to your .bashrc, .zshrc | |
# or anywhere where it gets loaded for your iTerm session | |
# 3. restart iTerm or 'source ~/.zshrc' and use these functions | |
set_color() { | |
local HEX_FG=$1 | |
local HEX_BG=$2 |
This file contains 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 Office < ActiveRecord::Base | |
belongs_to :teacher | |
accepts_nested_attributes_for :teacher | |
end | |
class Teacher < ActiveRecord::Base | |
has_one :office | |
end |
This file contains 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
# yes it is HAML | |
- Language.all.each do |language| | |
= label_tag do | |
= check_box_tag "teachers[language_ids][]", language.id, f.object.languages.include?(language) | |
= language.name |
This file contains 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 GpgWrapper | |
class GpgNotInstalled < StandardError; end | |
class CanNotFindPgpKey < StandardError; end | |
attr_reader :file_to_encrypt, :tmp_dir, :pgp_key, :email | |
def initialize(file_content, for_what = "customer") | |
check_gpg | |
load_config(for_what) | |
random_filename = "#{String.random}_#{Time.now.to_i}.xml" |
This file contains 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
$("<clickable anchor link selector selector>").click(function(ev){ | |
if (history && history.pushState) { | |
$(function() { | |
history.pushState(null, document.title, this.href+ev.currentTarget.hash); | |
ev.preventDefault(); | |
}); | |
}; | |
}); |
NewerOlder