This file contains hidden or 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
#!/bin/bash | |
#### | |
# Description: Installs latest MySQL Server 5.7 version from MySQL PPA. | |
# | |
# Runs on: All platforms | |
# | |
# Usage: | |
# Add the following command to the setup of a build in the Project Settings | |
# |
This file contains hidden or 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
#!/bin/bash | |
data_dir="/usr/data" | |
function prepare-data-dir(){ | |
echo "* Preparring data directory" | |
sudo mkdir $data_dir | |
sudo chown mysql:mysql $data_dir | |
} |
This file contains hidden or 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
# Only works with leading spaces (not tabs) and with existing params | |
# So get :edit, id: 1 # will work | |
# But get :edit # won't | |
%s/\(^ *\)\(get\|post\|patch\|delete\) \(:[^,]*\), \(.*$\)/\1process \3, via: :\2, params: { \4 }/ge |
This file contains hidden or 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 | |
orig_hits = [] | |
spec_hits = [] | |
# In Mountion Lion Apple uses BSD grep with REG_ENHANCED enabled, | |
# so all regular regex special chars like ?, | and + need to be | |
# escaped... | |
def grep_focus | |
if `grep --v`.match /BSD/ |
This file contains hidden or 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
module Terrys_rspec_helpers | |
def boolean_default_false(method) | |
exists(method) | |
it "should default to false" do | |
[email protected] | |
expect(new_thing.send(method)).to be_false | |
end | |
end |
This file contains hidden or 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 "spork" | |
Spork.prefork do | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
require 'email_spec' | |
require 'rspec/autorun' | |
require 'factory_girl' |
This file contains hidden or 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
source 'https://rubygems.org' | |
# ALPHABETICAL ORDER, please, to avoid duplication. | |
# gem 'gemname', [require: false, ], [group: [:if_necessary]] | |
# comment out anything not being used yet. Even if it'll be used later | |
gem 'airbrake' | |
gem 'ancestry' #rails g migration add_ancestry_to_things ancestry:string | |
gem 'autotest-rails', group: [:development,:test] |
This file contains hidden or 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
#ignore vim temp files | |
*.swo | |
*.swp | |
/coverage | |
/public/uploads | |
# mac-specific | |
.DS_Store |
This file contains hidden or 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
=simple_form_for event do |f| | |
=f.input :asset_attachment, :as=>:file,:label=>"Image" | |
=f.input :asset_attachment_remove, :as=>:boolean, :label=>'Remove' if event.asset | |
=nice_asset(event.asset,:thumb95x95) | |
=f.input :asset_attachment_title,:label=>"Image Description", :input_html => {:value=>(event.asset ? event.asset.title : "")} |
This file contains hidden or 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
#turn an email address into a javascript-built email link, to frustrate email harvest bots | |
def protected_email_link(e=nil) | |
if e.present? | |
name,domain=e.split('@') | |
content_tag(:script,type:"text/javascript") do | |
raw("emailE=('#{name}'+'@'+'#{domain}');"+ | |
"document.write('<a href=\"mailto:' + emailE + '\">'+ emailE + '</a>');") | |
end | |
end | |
end |
NewerOlder