Skip to content

Instantly share code, notes, and snippets.

View forkata's full-sized avatar

Chris Todorov forkata

View GitHub Profile

We need an improvement to our architecture to allow us to test portions of spree more easily. However I believe we will always need working complete factories form, at least for integration tests.

Regardless of what we're to do in the future. I thought it may be useful to document why all these queries are currently run, and what options we have to reduce their number.

[1] pry(#)> create(:line_item)
@cbrunsdon
cbrunsdon / gist:7272584
Created November 1, 2013 21:56
frt weechat grove settings
/server add frt freerunningtech.irc.grove.io/6697 -ssl
/set irc.server.frt.password freerunningtech
/set irc.server.frt.ssl_verify no
/set irc.server.frt.username "clarke"
/set irc.server.frt.command "/msg NickServ identify ******":
@jhawthorn
jhawthorn / bundle.sh
Last active December 24, 2015 16:59
using vendor/bundle with spree
for dir in api backend core frontend sample .; do
mkdir -p "$dir/.bundle"
cat > "$dir/.bundle/config" << EOF
BUNDLE_DISABLE_SHARED_GEMS: '1'
BUNDLE_PATH: '`pwd`/vendor/bundle'
EOF
done
@jhawthorn
jhawthorn / install.sh
Last active December 21, 2015 09:29
Installing IE VMs on ubuntu Needs 50-60 GB of free disk space
# Ensure VT-x is enabled in the BIOS
sudo apt-get install virtualbox unar
wget http://download.virtualbox.org/virtualbox/4.2.10/Oracle_VM_VirtualBox_Extension_Pack-4.2.10.vbox-extpack
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.2.10.vbox-extpack
curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | bash
# Wait a long time...
@ryansobol
ryansobol / gist:5252653
Last active February 23, 2025 06:28
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 28, 2025 00:02
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@wrburgess
wrburgess / README.md
Last active August 31, 2017 09:53
How to add a custom calculator for shipping or taxes to Spree
  1. Add initializer to config/application.rb
  2. Add new class to app/models/spree/calculators/[class_name].rb
  3. Add logic to class file

Class must have the following methods:

def self.description
  "Custom FlexiRate"
end
@ivanvanderbyl
ivanvanderbyl / gist:4222308
Created December 6, 2012 06:55
Postgres 9.1 to 9.2 upgrade guide for Ubuntu 12.04
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2
sudo su -l postgres
psql -d template1 -p 5433
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
service postgresql stop
/usr/lib/postgresql/9.2/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.2/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.2/main/ -O "-c config_file=/etc/postgresql/9.2/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"
@alexbevi
alexbevi / pre-commit.sh
Created August 23, 2012 12:05
Git pre-commit hook that checks ruby source files for Pry breakpoints
# Git pre-commit hook to check all staged Ruby (*.rb/haml/coffee) files
# for Pry binding references
#
# Installation
#
# ln -s /path/to/pre-commit.sh /path/to/project/.git/hooks/pre-commit
#
# Based on
#
# http://codeinthehole.com/writing/tips-for-using-a-git-pre-commit-hook/
@jhawthorn
jhawthorn / paperclip_interpolator.rb
Created March 2, 2012 23:05
paperclip interpolator
class PaperclipInterpolator
def initialize pattern
@pattern = pattern
@methods = []
@template = Paperclip::Interpolations::all.reverse.inject( pattern.dup ) do |result, tag|
result.gsub(/:#{tag}/) do |match|
@methods << tag.to_sym
"%{#{tag}}"
end
end