This file contains hidden or 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
require 'carrierwave/orm/mongoid' | |
CarrierWave.configure do |config| | |
config.storage = :s3 | |
config.s3_access_key_id = ENV["AWS_ACCESS_KEY_ID"] | |
config.s3_secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"] | |
config.s3_bucket = ENV["AWS_S3_ATTACHMENT_BUCKET"] | |
end | |
if Rails.env.test? |
This file contains hidden or 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
Account.active.paying.select([:id, :company_name]).includes(:account_owner).each do |account| | |
Saaspulse.async_record( | |
:activity => "Purchase", | |
:module => "Account", | |
:org => account.company_name, | |
:user => account.account_owner.name | |
) | |
end |
This file contains hidden or 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
<!-- Add this: --> | |
<script> | |
$(function(){ | |
// pjax | |
$('a.pjax').pjax('#container'); | |
}) | |
</script> | |
<!-- then change this: --> | |
<a onclick="return false" class="link" data-pjax="#container" href="/hotline">Engineer Hotline</a> |
This file contains hidden or 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
# syntax sugar for http://bit.ly/jMMVOF | |
class Time | |
def to_ms | |
(self.to_f * 1000.0).to_i | |
end | |
end |
This file contains hidden or 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
# Easily print methods local to an object's class | |
class Object | |
ANSI_BOLD = "\033[1m" | |
ANSI_RESET = "\033[0m" | |
ANSI_LGRAY = "\033[0;37m" | |
ANSI_GRAY = "\033[1;30m" | |
def local_methods | |
(methods - Object.instance_methods).sort | |
end |
This file contains hidden or 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
@events = Event.all | |
for event in @events | |
# event has_many perspectives | |
for perspective in event.perspectives | |
# perspective has_many attachments | |
for attachment in perspective.attachments | |
# attachment has an asset with an url | |
puts attachment.asset.url |
This file contains hidden or 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
# Mac OS X Finder and whatnot | |
.DS_Store | |
# XCode (and ancestors) per-user config (very noisy, and not relevant) | |
*.mode1 | |
*.mode1v3 | |
*.mode2v3 | |
*.perspective | |
*.perspectivev3 | |
*.pbxuser |
This file contains hidden or 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
Failures: | |
1) DonationObserver On creating a new donation should create a corresponding entry | |
Failure/Error: let!(:donation) { Factory(:donation, :amount => 100) } | |
ArgumentError: | |
wrong number of arguments (0 for 2) | |
# ./spec/models/donation_observer_spec.rb:4 | |
2) DonationObserver On deleting a donation should delete its entry | |
Failure/Error: let!(:donation) { Factory(:donation, :amount => 100) } |
This file contains hidden or 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
[20:18:51] phlipper@WOPR [~]$ openssl passwd -1 test123 | |
$1$axBB.gQW$4MW2bY6Dd/5xAfKbJvJpx/ |
This file contains hidden or 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
:users => [ | |
{ | |
:username => "shasta", | |
:full_name => "Shasta Application", | |
:password => "$1$axBB.gQW$4MW2bY6Dd/5xAfKbJvJpx/", | |
:authorized_keys => [ | |
"ssh-rsa xxxVnvQB/bQOOrwKK8pfEeY3TFeW/BTC71skze9+YxBYuEoTZDhzpFY9N8gRLc567iOBTuvNKVsBnELgWd/g056ulCK3SMHpTrENWsdNEp0yS319BW5Kyr0xGXkzWH2Q/SKkVWqH6bW2hFTU23fGOema+WuKc41crlNwaQVbhchiAnJCJ7RpDqyNPZKQ8h5Kw9v96d261YWxuNA0ZDqkusbkFt5h3LUoRfC/foXy7M2+tMy9CuDmC5uLJU6UCAtWRwpmGj2oTEUeCagLcyEi/Y5DS32KzvEXXwFm1PsA6iRKxfDY0qYWlVG0JXz6hVrQWRJuh3DrwuLlw==", | |
"ssh-rsa xxx1yc2EAAAABJQAAAIEA13WvDodzAp9JN0YTR7F9NylTo7isVqtLssq7xlRbTjjSOfqTFMXj4hYoMaE03Y3IbwO1Zq4NPM7jT5Ulsfx5koNmOjH805n5w9Fcmhj5Ty7prXfEdfTU5jexUglR4Lq6N7bH+vDZEeoxIrGtV9lcnRpr9o7ulxK3dYrBSqKhi+k=" | |
], | |
:home => "/home/shasta", |