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
var Page = Page || {}; | |
(function(Page) { | |
'use strict'; | |
var routeQueue = []; | |
Page.runRouteQueue = function(){ | |
routeQueue.forEach(function(cb, index, array) { | |
cb(); | |
}); | |
}; |
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
# expect(json).to have_serialized(post).with(PostSerializer) | |
RSpec::Matchers.define :have_serialized do |unserialized| | |
# The serializer to use on the resource | |
chain :with do |serializer| | |
@serializer = serializer | |
end | |
# The serializer to use on the collection | |
chain :wrap do |collection_serializer| | |
@collection_serializer = collection_serializer |
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
MySQL Collation Checkup | |
SELECT @@character_set_database, @@collation_database | |
INTO OUTFILE '/tmp/table_defaults_charset.csv' | |
FIELDS TERMINATED BY ',' | |
OPTIONALLY ENCLOSED BY '"' | |
LINES TERMINATED BY '\n'; | |
SELECT * FROM information_schema.schemata | |
INTO OUTFILE '/tmp/schema_charset.csv' |
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
# * /blueprints | |
# * /{version_name} | |
# * | |
# * manifest.yml | |
# | |
# :v1: | |
# - meta | |
# - structures/* | |
# - resources/addresses | |
# - resources/countries |
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
env = Dir['myproject/**/*.rb']. | |
map { |file| File.read(file).match(/ENV\[['"](.+?)(?=[\]'"])/) }. | |
compact. | |
map{|matchdata| matchdata[1]}.uniq.sort |
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 :app do | |
# List of models that are in the new app, that should not be revoked yet from app-transition | |
# The goal should be to keep this VERY SHORT. Users is being added here because its a god | |
# model. | |
DONT_REVOKE = %w(users) | |
ACCOUNT_NAME = 'app-transition' | |
SCHEMA_NAMES = ['app_development', 'app_test'] | |
namespace :db do | |
desc "Disregard transitionary permissions on old MySQL Account" |
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 :ci do | |
desc "Flog it" | |
task :flog do | |
max_score = 10.0 | |
changed_files = `git diff develop --name-only | grep "app/" | grep ".rb" | tr '\n' ' '`.split(' ') | |
if changed_files.any? | |
avg_score = `flog -g -s #{changed_files.join(' ')} | tail -n 1` | |
score = avg_score.match( /(\d+\.\d+)/)[0].to_f |
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
filters = Rails.application.config.filter_parameters | |
f = ActionDispatch::Http::ParameterFilter.new filters | |
f.filter user:{password: 'haha’} # => user: {:password=>"[FILTERED]"} | |
f.filter :password => 'haha' # => {:password=>"[FILTERED]"} |
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
POST /api/organizations/35/employees HTTP/1.1 | |
Host: example.com | |
X-Api-Version: 1 | |
Accept: application/vnd.api+json | |
Content-Type: application/vnd.api+json | |
Cache-Control: no-cache | |
{ | |
"data": { | |
"type": "employees", |
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 :ci do | |
desc "Flog it" | |
task :flog do | |
max_score = 10.0 | |
changed_files = `git diff develop --name-only | grep "app/" | grep ".rb" | tr '\n' ' '`.split(' ') | |
if changed_files.any? | |
lines = `flog #{changed_files.join(' ')}` | |
failures = lines.split("\n"). | |
drop(3). |