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
# frozen_string_literal: true | |
require 'rails_helper' | |
require 'immigrant' | |
RSpec.describe "assert that no foreign keys are added without constraints", :aggregate_failures do | |
# These relationships should not be thought of as real FKs | |
let(:ignored_constraints) { YAML.load(<<~YAML) } | |
--- | |
- :from_table: some_table |
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
RSpec::Matchers.define :eq_long_string do |expected| | |
match do |string| | |
expected == string | |
end | |
failure_message do |actual| | |
"Failed with [#{actual}]\n\n" \ | |
"Expected [#{expected}]" | |
end |
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 Timer | |
include Singleton | |
def initialize | |
Thread.current[:timers] ||= Hash.new(0) | |
end | |
def display(timer) | |
Thread.current[:timers][timer] | |
end |
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
#!/bin/sh | |
# Pre-commit hook for git which removes trailing whitespace, converts tabs to spaces, and enforces a max line length. | |
if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
fi |
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
scale = (inMin, inMax, outMin, outMax) -> | |
inMax = parseFloat(inMax) | |
inMin = parseFloat(inMin) | |
outMin = parseFloat(outMin) | |
outMax = parseFloat(outMax) | |
inRange = inMax - inMin | |
outRange = outMax - outMin | |
inMultiplier = 1 / inRange |
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
[{"id":1,"user_id":1,"foursquare_id":"5313fb49498eaddbc72fbc28","shout":"with Juan C.","latitude":"33.6248941821904","longitude":"-84.45117885518563","venue_name":"Sheraton Gateway Hotel Atlanta Airport","address":"1900 Sullivan Rd","city":"Atlanta","state":"GA","venue_type":"Hotel"},{"id":2,"user_id":1,"foursquare_id":"531369a5498e762e980ae869","shout":"with Juan C.","latitude":"37.25608836765668","longitude":"-77.39258870743865","venue_name":"Applebee's","address":"449 S. Park Cir.","city":"Colonial Heights","state":"VA","venue_type":"American"},{"id":3,"user_id":1,"foursquare_id":"5313021e11d230e8fdd6f96a","shout":null,"latitude":"40.739943978226975","longitude":"-73.99397873738853","venue_name":"Spotify","address":"45 W 18th St","city":"New York","state":"NY","venue_type":"Tech Startup"},{"id":4,"user_id":1,"foursquare_id":"5312f645498ec97349c6c20c","shout":null,"latitude":"40.738676864716815","longitude":"-73.9958151502776","venue_name":"Hollywood Diner","address":"574 6th Ave. (Avenue of the Americas)", |
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
for i in `find . \( -name '*html*' -or -name '*.rb' -or -name '*css' -or -name '*sass' -or \ | |
-name '*.feature' \) -type f \! \( -path '*.git*' -or -path '*tmp*' -or -path '*solr*' -or \ | |
-path '*/log/*' -or -path '*/public/*' -or -path '*/vendor/*' \)` | |
do | |
echo "Processing ${i}..." | |
cat -s "$i" > "$i.work"; mv "$i.work" "$i" # remove mulptiple lines empty within file | |
awk '/^$/ {nlstack=nlstack "\n";next;} {printf "%s",nlstack; nlstack=""; print;}' "$i" > "$i.work"; mv "$i.work" $i # only one new line character at EOF | |
done |
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
$ rvm ruby-1.9.3-p429@platform-dev-param --create | |
$ bundle check | |
Gemfile syntax error: | |
Gemfile:12: syntax error, unexpected ':', expecting $end | |
gem "sso", git: "[email protected]:challengepost... | |
^ | |
Gemfile syntax error: | |
Gemfile:12: syntax error, unexpected ':', expecting $end | |
gem "sso", git: "[email protected]:challengepost... | |
^ |
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
--ignore-ack-defaults | |
--ignore-directory=is:.bzr | |
--ignore-directory=is:.cdv | |
--ignore-directory=is:~.dep | |
--ignore-directory=is:~.dot | |
--ignore-directory=is:~.nib | |
--ignore-directory=is:~.plst | |
--ignore-directory=is:.git | |
--ignore-directory=is:.hg | |
--ignore-directory=is:.pc |
NewerOlder