Skip to content

Instantly share code, notes, and snippets.

View rimian's full-sized avatar

Rimian Perkins rimian

View GitHub Profile
bundle exec cap production rails:console
c = Custcare::Contact.where(:email => '[email protected]').first
c.confirm!
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA+FCOW20oxzv6i7hPMNycrlJ0SsmTSNl8IH6yI9CMXv0B4cwOt24dLNEaX95CaXWoHaqMv6u6vkfS8T7MSRMzCTBl7HIrkszXCT/WDtNTV/qaHurRPn0dlxJSeDc52p01+MdGC+b+e7rNRQSt0fV68X0R2EXn3amKfesLqNsv6GQXkzhvNpkafbBc+jIwsfFr0H8sdJODmdjMtugbysPrB+9b/lTPryg01J4Fubwux43X+rSqD5qbCEATeyFeKmb01rjFUQLtfFMRozaeMyzZqxtgQvGoiBiSNB/9hXoJA/oWog1l3yHfakBnkx3L10eN6HfHg2s+Uj6rEPxa2fal3Q== [email protected]
@rimian
rimian / gist:5572765
Last active December 17, 2015 07:29
remove merged git branches
#!/bin/bash
current_branch=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
if [ "$current_branch" != "master" ]; then
echo "WARNING: You are on branch $current_branch, NOT master."
fi
echo -e "Fetching merged branches...\n"
git remote update --prune
remote_branches=$(git branch -r --merged | grep -v '/master$' | grep -v "/$current_branch$")
class Mailer < ActionMailer::Base
default from: "[email protected]"
def notify
'notify'
end
end
def a
true
end
def b
true
end
def c
true
end
def d
# Doesn't work when code = nil because the operator in the SQL should be 'is' not '='
def shipping_options
if @promotion.present?
code = @promotion.code
else
code = nil
end
Shipping.where('promotion_code = ? AND is_bulky = ? AND minimum_spend <= ?',
code, self.bulky_order?, self.calculate_total_price.to_f)
@rimian
rimian / ima.md
Created May 24, 2012 12:57 — forked from radar/ima.md

You don't drink beer, oh ok well I didn't know that you just said false things for the fun of it, why would you make multiple references to drinking beer at railscamp if you don't drink any beer? Or do you just put out a different appearance in public than you do in private?

@rimian
rimian / best_practice_request_specs
Created May 17, 2012 04:32
best practice request specs
require 'spec_helper'
describe "request spec test" do
before(:each) do
#log into devise (testing sub domains with capybara work around)
create_user()
sign_in
click_link_to_a_page()
end
@rimian
rimian / big iframe document
Created May 11, 2012 02:42
big iframe document
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test for large thing in iframe</title>
</head>
<body>
<div style="width: 2200px; height: 700px; background: gold;"> </div>
</body>
</html>