Skip to content

Instantly share code, notes, and snippets.

Sean Cribbs seancribbs

Block or report user

Report or block seancribbs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:77271
define :mysql_database, :action => 'create' do
def mysql(command, config=nil, )
"mysql --defaults-file=#{config} --execute=#{command.inspect}"
end
include_recipe "mysql::client"
# For now, use the super-user conf
case @node[:platform]
when "debian", "ubuntu"
View legacy-html.conf
<VirtualHost *:80>
ServerName mc-portal.hellovenado.com
View gist:85701
# Radiant additions
namespace :deploy do
task :migrate_extensions, :role => :db do
run "cd #{current_path}; rake #{rails_env} db:migrate:extensions"
end
task :update_extensions, :role => :db do
run "cd #{current_path}; rake #{rails_env} radiant:extensions:update_all"
end
end
View cucumber.diff
diff --git a/lib/dataset.rb b/lib/dataset.rb
index 54bd20b..5be76d5 100644
--- a/lib/dataset.rb
+++ b/lib/dataset.rb
@@ -69,7 +69,9 @@ require 'dataset/record/model'
#
module Dataset
def self.included(test_context) # :nodoc:
- if test_context.name =~ /TestCase\Z/
+ if test_context.name =~ /World\Z/
View metagrammar.peg
rules <- space? declaration_sequence space?
declaration_sequence <- head:declaration tail:(space declaration)*
declaration <- nonterminal space '<-' space parsing_expression
parsing_expression <- choice / sequence / primary
choice <- head:alternative tail:(space? '/' space? alternative)+
@seancribbs
seancribbs / crazy-chef-recipe.erl
Created May 16, 2009
Sketch of what a Chef recipe might look like in Erlang. But it should never happen.
View crazy-chef-recipe.erl
#remote_file{
name="/usr/local/src/ruby-enterprise-1.8.6-20090421.tar.gz",
url="http://rubyforge.org/frs/download.php/55511/ruby-enterprise-1.8.6-20090421.tar.gz",
not_if=fun() -> filelib:is_file("/usr/local/src/ruby-enterprise.tar.gz") end
},
#execute{
name="expand REE tarball",
command="tar xzf ruby-enterprise-1.8.6-20090421.tar.gz",
pwd="/usr/local/src",
View gist:113252
rm -f src/herml_scan.erl
rm -f src/herml_parse.erl
rm -f ebin/*
rm -f ebin_tests/*
erl -noshell -s init stop -eval 'leex:file("src/herml_scan.xrl", [{outdir, "src"}])'
erl -noshell -s init stop -eval 'yecc:file("src/herml_parse.yrl")'
cp src/herml.app ebin
cd src;erl -make
Recompile: herml_scan
Recompile: herml_reader
@seancribbs
seancribbs / sphinx_cucumber.rb
Created May 18, 2009
Runs a Sphinx search server during Cucumber features.
View sphinx_cucumber.rb
module SphinxCucumber
def start_sphinx!
ThinkingSphinx.tap do |sphinx|
# Don't show delta indexing output while running features,
# but enable deltas so we can find records we create
sphinx.deltas_enabled = true
sphinx.suppress_delta_output = true
# Build the sphinx config and start the server [cribbed from the plugin]
ThinkingSphinx::Configuration.instance.tap do |config|
View gist:115511
namespace :deploy do
task :default do
run "cd #{deploy_to} && git pull"
clear_cache
end
task :clear_cache do
# do something here to clear the cache
end
end
View gist:130453
additive <- multitive "+" additive / multitive;
multitive <- primary "*" multitive / primary;
primary <- "(" additive ")" / decimal;
decimal <- [0-9];
You can’t perform that action at this time.