Skip to content

Instantly share code, notes, and snippets.

@pkordel
pkordel / sphinx.rb
Last active August 29, 2022 10:07
Install sphinx with homebrew and postgresql support
class Sphinx < Formula
desc "Full-text search engine"
homepage "https://sphinxsearch.com/"
url "https://sphinxsearch.com/files/sphinx-2.2.11-release.tar.gz"
sha256 "6662039f093314f896950519fa781bc87610f926f64b3d349229002f06ac41a9"
license "GPL-2.0"
revision 3
head "https://github.com/sphinxsearch/sphinx.git", branch: "master"
bottle do
RSpec.configure do |config|
config.filter_run focus: true
config.run_all_when_everything_filtered = true
config.fail_fast = true
ActiveRecord::Base.observers.disable :all
config.infer_spec_type_from_file_location!
config.expose_current_running_example_as :example
config.include JsonHelpers
config.include WaitForAjax, type: :feature
config.before(:each, js: true) do
@pkordel
pkordel / gist:5386788
Created April 15, 2013 08:49
Recursive parsing challenge
# Should return this:
# [
# ["(0) Mammal", 1],
# ["(0) Mammal | (0) Dog", 3],
# ["(0) Mammal | (0) Dog | (0) Dobey", 6],
# ["(0) Mammal | (0) Dog | (1) Beagle", 5],
# ["(0) Mammal | (1) Cow", 4],
# ["(0) Mammal | (2) Cat", 2]
# ]
source 'https://rubygems.org'
#gem 'rails', '4.0.0.beta'
# Bundle edge Rails instead:
gem 'rails', github: 'rails/rails'
gem 'journey', github: 'rails/journey'
gem 'activerecord-deprecated_finders', github: 'rails/activerecord-deprecated_finders'
gem 'sqlite3'
@pkordel
pkordel / .rvmrc
Created September 30, 2012 11:40
rvm use 1.9.3@rails4 --create
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'journey', github: 'rails/journey'
gem 'activerecord-deprecated_finders', github: 'rails/activerecord-deprecated_finders'
require 'rubygems'
require 'redgreen'
require 'autotest/growl'
require 'autotest/fsevent'
Autotest::Growl::clear_terminal = false
def payment_method
PaymentMethod.available.select{|p| p.is_a? BillingIntegration::PaypalExpress}.first.id
end
hi there