Skip to content

Instantly share code, notes, and snippets.

require 'concurrent/array'
Capybara::Session.prepend(Spec::Support::Capybara::Console)
module Spec
module Support
module Capybara
module Console
def driver
@driver ||= super.tap { console.register }
@ngan
ngan / mysql.rb
Last active August 29, 2015 14:06
MySQL 5.5.33 Formula
require 'formula'
class Mysql < Formula
homepage 'http://dev.mysql.com/doc/refman/5.5/en/'
url 'http://downloads.mysql.com/archives/mysql-5.5/mysql-5.5.33.tar.gz'
version '5.5.33'
sha1 '40c6d63e8a959458737f6fa485d3598c12aef670'
depends_on 'cmake' => :build
depends_on 'pidof' unless MacOS.version >= :mountain_lion
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authorization</AllowedHeader>
</CORSRule>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
@ngan
ngan / gist:5625707
Created May 22, 2013 06:50
proof of concept for POST instead of GET
diff --git a/config/routes.rb b/config/routes.rb
index acc4f35..39d734c 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,5 +1,5 @@
Teabag::Engine.routes.draw do
get "/fixtures/*filename", to: "spec#fixtures"
- get "/:suite", to: "spec#runner", defaults: { suite: "default" }
+ match "/:suite", to: "spec#runner", defaults: { suite: "default" }
root to: "spec#suites"
shared_examples "a measurable object" do |measurement, measurement_methods|
measurement_methods.each do |measurement_method|
it "should return #{measurement} from ##{measurement_method}" do
subject.send(measurement_method).should == measurement
end
end
end
describe Array, "with 3 items" do
subject { [1, 2, 3] }
@ngan
ngan / sphinx.rb
Last active October 7, 2015 15:28
Sphinx 0.9.9 Formula
class Sphinx < Formula
homepage 'http://www.sphinxsearch.com'
url 'http://sphinxsearch.com/files/archive/sphinx-0.9.9.tar.gz'
sha1 '8c739b96d756a50972c27c7004488b55d7458015'
version '0.9.9'
head 'http://sphinxsearch.googlecode.com/svn/trunk/'
devel do
url 'http://sphinxsearch.com/files/sphinx-2.1.1-beta.tar.gz'
@ngan
ngan / vim.rb
Created July 22, 2012 16:31 — forked from uasi/vim.rb
Vim formula for Homebrew
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d'
version '7.3.617'
def features; %w(tiny small normal big huge) end
@ngan
ngan / imagemagick.rb
Last active July 28, 2021 22:47
ImageMagick 6.6.2-6 Formula
# This Formula is for ImageMagick 6.6.9-7 for OS X Mountain Lion
require 'formula'
class Imagemagick < Formula
homepage 'http://www.imagemagick.org'
# upstream's stable tarballs tend to disappear, so we provide our own mirror
# Tarball from: http://www.imagemagick.org/download/ImageMagick.tar.gz
# SHA-256 from: http://www.imagemagick.org/download/digest.rdf
# This method provides a way for overriding an existing rake task. Currently,
# in Rake, there is no way to override--only append.
#
# Example usage:
#
# namespace :db do
# override_task :migrate => :environment do
# puts "Do some stuff before!"
#
# # Call the original task