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
#{Rails.root}/lib/tasks/databases.rake | |
# monkey patch ActiveRecord to avoid There are n other session(s) using the database. | |
def drop_database(config) | |
case config['adapter'] | |
when /mysql/ | |
ActiveRecord::Base.establish_connection(config) | |
ActiveRecord::Base.connection.drop_database config['database'] | |
when /sqlite/ | |
require 'pathname' | |
path = Pathname.new(config['database']) |
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 CreateImports < ActiveRecord::Migration | |
def self.up | |
create_table :imports do |t| | |
t.string :datatype | |
t.integer :processed, :default => 0 | |
t.string :csv_file_name | |
t.string :csv_content_type | |
t.integer :csv_file_size | |
t.timestamps | |
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
// ref: http://paranoida.github.io/sass-mediaqueries/ | |
@media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 1.3 / 1), only screen and (min-resolution: 125dpi), only screen and (min-resolution: 1.3dppx) { | |
// special defined | |
} | |
// iPad | |
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { | |
// special defined |
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
function centerModal() { | |
$(this).css('display', 'block'); | |
var $dialog = $(this).find(".modal-dialog"); | |
var offset = ($(window).height() - $dialog.height()) / 2; | |
// Center modal vertically in window | |
$dialog.css("margin-top", offset); | |
} | |
$('.modal').on('show.bs.modal', centerModal); | |
$(window).on("resize", function () { |
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 'deploy' if respond_to?(:namespace) # cap2 differentiator | |
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } | |
load 'config/deploy' |
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
# chmod 777 install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
echo "*****************************************" | |
echo " 1. Prerequisites: Install updates, set time zones, install GCC and make" | |
echo "*****************************************" | |
sudo yum -y update | |
#sudo ln -sf /usr/share/zoneinfo/America/Los_Angeles \/etc/localtime | |
sudo yum -y install gcc gcc-c++ make | |
echo "*****************************************" |
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
.btn-group-radio input[type=radio] { | |
visibility: hidden; | |
position: absolute !important; | |
top: -9999px !important; | |
left: -9999px !important; | |
} | |
.btn-group-radio input[type=radio]:checked + .btn { | |
color: #333333; | |
background-color: #e6e6e6; |
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
thunk = lambda do |key,value| | |
case value | |
when String then value.strip! | |
when Hash then value.each(&thunk) | |
when Array then value.each {|vv| vv.strip!} | |
end | |
end | |
[Hash].each(&thunk) |