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
#!/usr/bin/env ruby | |
def add_new_git_template | |
# Paths | |
home_dir = File.expand_path('~') | |
template_dir = File.join(home_dir, ".git_template") | |
hooks_dir = File.join(template_dir, "/hooks") | |
pre_commit_file = File.join(hooks_dir, "pre-commit") |
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
changeViewportMeta = function() { | |
$('meta[name=viewport]').attr('content', 'user-scalable=yes, initial-scale=1, maximum-scale=1.3, width=device-width'); | |
if ($(window).width() <= 320) { | |
return $('meta[name=viewport]').attr('content', 'user-scalable=yes, initial-scale=0.63, maximum-scale=1.3, width=480'); | |
} else if ($(window).width() <= 480) { | |
return $('meta[name=viewport]').attr('content', 'user-scalable=yes, initial-scale=0.89, maximum-scale=1.3, width=480'); | |
} else if ($(window).width() <= 768) { | |
return $('meta[name=viewport]').attr('content', 'user-scalable=yes, initial-scale=0.8, maximum-scale=1.3, width=920'); | |
} else if ($(window).width() <= 1024) { | |
return $('meta[name=viewport]').attr('content', 'user-scalable=yes, initial-scale=0.85, maximum-scale=1.3, width=920'); |
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
# db/migrations/20120118012543_create_site_configuration.rb | |
class CreateSiteConfigurations < ActiveRecord::Migration | |
def change | |
create_table :site_configurations do |t| | |
t.string :key | |
t.text :value | |
t.string :form_type | |
t.string :form_collection_command |
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 Package < ActiveRecord::Base | |
has_many :products, :through => :packagings, extend => QuantityAssociation | |
# ... do stuff | |
end | |
module QuantityAssociation | |
def include_duplicates |
NewerOlder