- Start a Sinatra server on port 4000
- GET / to that server triggers a
git pull
and mod_rails restart - Hit port 4000 locally after pushing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
version="1.7.7" | |
pcre_version="8.36" | |
openssl_version="1.0.1j" | |
libressl_version="2.1.1" | |
pagespeed_version="1.9.32.1" | |
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create_table "permits", :force => true do |t| | |
t.string "number", :null => false | |
t.string "name", :null => false | |
t.string "agency_project" | |
t.integer "contact_id" | |
t.string "category" | |
t.string "when_req" | |
t.string "owner" | |
permit_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Originally written by http://redartisan.com/tags/csv | |
# Added and minor changes by Gavin Laking | |
# more changes by Kurt Sussman (don't expect 'id' in col#1, no attribute if no data) | |
# | |
# "id","name","mime_type","extensions","icon_url" | |
# "1","unknown","unknown/unknown","||","/images/icon/file_unknown.gif" | |
# "2","image/tiff","image/tiff","|tiff|tif|","/images/icon/blank.png" | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def extract_model_name(controller_class); controller_class.to_s.match(/(.+)Controller/)[1]; end | |
def model(controller_class); extract_model_name(controller_class).singularize.constantize; end | |
def symbol_for_model(controller_class, options = {}) | |
tablename = extract_model_name(controller_class).tableize | |
options[:pluralize] ? tablename.to_sym : tablename.singularize.to_sym | |
end | |
describe "an ordinary 'show' action", :shared => true do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
start_time = Time.now | |
SOURCE_DB = { | |
:name => 'db_name', | |
:user => 'db_user', | |
:password => 'db_pass', | |
:host => 'localhost' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
View: | |
#block | |
%h3 Export | |
%ul{:class=>"horizontal"} | |
%li | |
- if controller.action_name == 'show' | |
= link_to "Open this Permit in Excel", permit_path(@item, :format => :csv) | |
- if controller.action_name == 'index' | |
= link_to "Open the list of Permits in Excel", permits_path(:format => :csv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run from inside nginx directory | |
./configure --prefix='/opt/nginx' --with-pcre='../pcre-8.12' \ | |
--add-module='/usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/ext/nginx' \ | |
--without-http_autoindex_module \ | |
--without-http_ssi_module \ | |
--with-openssl=../openssl-1.0.0d/ \ | |
--http-log-path=/var/log/nginx/access.log \ | |
--error-log-path=/var/log/nginx/error.log \ | |
--pid-path=/var/run/nginx.pid \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/home/vagrant/.rbenv/versions/1.9.3-p429/bin/ruby -S rspec ./spec/controllers/home_controller_spec.rb ./spec/helpers/application_helper_spec.rb ./spec/models/comment_spec.rb ./spec/models/email_parser_spec.rb ./spec/models/message_spec.rb ./spec/models/stories_paginator_spec.rb ./spec/models/story_repository_spec.rb ./spec/models/story_spec.rb ./spec/models/user_spec.rb ./spec/models/vote_spec.rb | |
/home/vagrant/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/activesupport-4.1.12/lib/active_support/dependencies.rb:247:in `require': cannot load such file -- awesome_print (LoadError) | |
from /home/vagrant/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/active from /home/vagrant/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1065:in `block in load_spec_files' | |
from /home/vagrant/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1065:in `each' | |
from /home/vagrant/.rbenv/versio |
OlderNewer