Skip to content

Instantly share code, notes, and snippets.

describe 'enqueue' do
it 'enqueues the back fill for a site' do
expect(ResqueHelpers).to receive(:enqueue)
.with(Backfill::ResqueJobs::Site, site_id, start_time, end_time)
subject.enqueue
end
end
describe 'enqueue' do
it 'enqueues the back fill for a site' do

Rails Girls 2015


L.A. Adventure App

Made by Your Name

server {
listen 80 default_server backlog=2048;
root /srv/www/build;
index index.html;
# Make site accessible from http://localhost/
server_name localhost;
location / {
@justinleveck
justinleveck / set_config_values.rb
Last active August 29, 2015 14:24
Script to set CS-Cart config.local.php values using environment variable values
#!/usr/bin/env ruby
file_names = ['path/to/config.local.php']
config_values = [
'CS_CART_DB_HOST',
'CS_CART_DB_NAME',
'CS_CART_DB_USER',
'CS_CART_DB_PASSWORD',
'CS_CART_HTTP_HOST',
picc.format = (function() {
var formatter = function(fmt, _empty) {
var round = false;
if (typeof fmt === 'string') {
round = !!fmt.match(/d$/);
fmt = d3.format(fmt);
}
return function(key, empty) {
empty = empty || _empty;
if (typeof empty === 'string') {
@justinleveck
justinleveck / 0_reuse_code.js
Created September 30, 2015 17:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Money.new(payment_transactions.succeeded.joins(:offer_purchase).sum("#{OfferPurchase.table_name}.price_in_cents"))
@justinleveck
justinleveck / gist:5660915
Created May 28, 2013 06:52
Project Euler - Problem 16
#215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
#What is the sum of the digits of the number 21000?
def exp(base, power)
return base**power
end
def sum_digits(digits)
sum = 0
@justinleveck
justinleveck / database.yml
Last active December 18, 2015 02:19
PG::Error: ERROR: encoding UTF8 does not match locale en_US
development:
adapter: postgresql
database: x_development
username: vagrant
pool: 5
encoding: utf8
template: template0
test: