Skip to content

Instantly share code, notes, and snippets.

View tadast's full-sized avatar

Tadas Tamošauskas tadast

View GitHub Profile
@tadast
tadast / heroku_colors.sh
Created August 10, 2011 15:07
Colorize heroku production console for iTerm2 on OSX
# 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
class Office < ActiveRecord::Base
belongs_to :teacher
accepts_nested_attributes_for :teacher
end
class Teacher < ActiveRecord::Base
has_one :office
end
# 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
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"
@tadast
tadast / Preventing anchor links from scrolling
Created January 18, 2011 21:18
how to prevent anchor links from scrolling to id element but update address bar with hash (useful for some sort of tabs)