I hereby claim:
- I am spannerinworks on github.
- I am spannerinworks (https://keybase.io/spannerinworks) on keybase.
- I have a public key whose fingerprint is B78E C80C 409B 7EA3 6E59 7009 AD07 BFEE A1C4 AA4A
To claim this, I am signing this object:
export HOMEBREW_GITHUB_API_TOKEN=0123456789abcdef | |
export JAVA_HOME=$(/usr/libexec/java_home) | |
export PATH="~/scripts:$PATH" | |
if [ ! -z "$PS1" ] ; then | |
source ~/scripts/git-prompt.sh | |
RVM_PROMPT="\[\033[1;36m\]\$(rvm-prompt.sh)\[\033[0m\]" |
require 'ostruct' | |
id = OpenStruct.new(to_i: 'BAD SQL') | |
bad_event = OpenStruct.new(id: id) | |
# > bad_event.id.to_i | |
# => "BAD SQL" |
#!/bin/bash | |
set -v | |
git show integration:db/schema.rb > db/schema.rb | |
RAILS_ENV=test rake db:drop | |
RAILS_ENV=test rake db:create | |
RAILS_ENV=test rake db:schema:load | |
RAILS_ENV=test rake db:migrate |
RSpec.describe 'test' do | |
it 'works' do | |
a = {a: 1, b: 'foobar'} | |
d = double | |
expect(d).to receive(:meh).with(a: 1, b: match(/ob/)) | |
d.meh(a) | |
end | |
end |
# --------------------------- | |
# In config/application.yml : | |
# | |
# development: | |
# blah: "foo" | |
# test: | |
# blah: "bar" | |
# | |
# --------------------------- | |
# In app: |
Don't expect pretty, it's a hack... | |
We need and END marker on the input because we have to tell the script to exit | |
$ cat > input.txt | |
a quick brown | |
fox jumple over the | |
laszy dog | |
END | |
$ heroku run "perl -pe 'exit if /^END$/; s/(\w)/\1\1/g;'" < input.txt > output.txt |
#!/usr/bin/perl -pi | |
$branch = `git symbolic-ref HEAD`; | |
chomp($branch); | |
$branch =~ s|^refs/heads/(MYC.\d+).*|\1|; | |
print "[${branch}] " if ($. == 1 && $branch =~ /^MYC.\d+$/); |
&:before { | |
@include border-radius(20px); | |
color: white; | |
position: absolute; | |
background-color: $link-text-colour; | |
content: "\FF0B"; | |
font-size: 30px; | |
height: 40px; | |
width: 40px; | |
left: 0; |
I hereby claim:
To claim this, I am signing this object:
module Mode
class Constraint
def initialize(mode)
@mode = mode
end
def matches?(_request)
@mode == Rails.application.config.mode # configured from the environment
end