It's common in Ruby to see some code setup a Struct
like this:
class Specialized < Struct.new(:whatever)
# ... define custom methods here...
end
# Reference: https://gist.github.com/1658360 | |
curl https://raw.github.com/gist/1658360/afd06eec533ad0140011bdaf652e6cd82eedf7ec/cumulative_performance.patch > $rvm_path/patches/ruby/1.9.3/p0/falcon.patch | |
rvm install 1.9.3 -n fast --patch falcon | |
rvm gemset copy 1.9.3-p0@global 1.9.3-p0-fast@global | |
rvm gemset copy 1.9.3-p0@plustrac 1.9.3-p0-fast@plustrac | |
bundle |
source 'https://rubygems.org' | |
source 'http://gems.github.com' | |
gem 'rspec' | |
gem 'remote_http_testing' | |
gem 'net-http-spy' | |
gem 'mechanize' | |
gem "ZenTest" | |
# Beautifying | |
gem 'awesome_print' |
location ~ ^/(wp-admin|wp-login\.php|priv\.dog|companies\/sidekick) { | |
deny all; | |
break; | |
} | |
# file extensions that should never be served, this prevents | |
# potential malicious downloads in case someone manages to manipulate | |
# a Rails URL or write a file that can be served | |
# (~* matches case-insensitive) | |
location ~* \.(?:git|svn|DS_Store|asp|aspx|cgi|pt|pl|idx|php|exe|scpt|AppleScript|dll|dmg|pif|msi|application|msp|com|scr|hta|cpl|gadget|msc|jar|bat|vb|vbs|vbe|ws|wsh|inf|lnk|reg|scf|wsc|wsh|ps1|ps1xml|ps2|ps2xml|psc1|psc2|msh|msh1|msh2|mshxml|msh1xml|msh2xml)$ { | |
deny all; |
# inspired by http://ariejan.net/2010/08/23/resque-how-to-requeue-failed-jobs | |
# retry all failed Resque jobs except the ones that have already been retried | |
# This is, for instance, useful if you have already retried some jobs via the web interface. | |
Resque::Failure.count.times do |i| | |
Resque::Failure.requeue(i) unless Resque::Failure.all(i, 1)['retried_at'].present? | |
end | |
# retry all :) | |
Resque::Failure.count.times do |i| |
find ~ -name '*.log' -print0 | xargs -0 -L1 stat -f'%z %N' | sort -rn | tee fat-logfiles.txt | head | |
awk '{ total += $1 } END { printf "total: %5.2f MiB\n", total/1024/1024 }' < fat-logfiles.txt |
Chances are your head's spinning right now. That accusation of bias caught you off guard, you got kind of defensive, and now all hell has broken loose. You're feeling attacked on all sides. You're a good person at heart, and having all these people treat you like the antichrist is pretty upsetting.
You need to say something, but you're probably not in the best headspace to write copy right now. So to help you along, here's my 100% guaranteed-or-you-money-back scandal defusement apology template:
// Netlify function to tag subscribers in ConvertKit | |
// https://www.netlify.com/products/functions/ | |
// POST to /.netlify/functions/tag?id={subscriberId} with JSON array of tag ids: `[{tagId}, {tagId}, ...]` | |
const request = require("request-promise"); | |
const apiKey = process.env.CONVERTKIT_API_KEY; | |
const apiSecret = process.env.CONVERTKIT_API_SECRET; | |
exports.handler = function(event, context, callback) { |
You can break these rules if you can talk your pair into agreeing with you.
Just install this in your apps like so:
gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'