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
def template(from, to) | |
template_path = File.expand_path("../templates/#{from}", __FILE__) | |
template = ERB.new(File.new(template_path).read).result(binding) | |
upload! StringIO.new(template), to | |
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
# Encoding: UTF-8 | |
SIG_REGEX = /(--|__|\w-$)|(^(\w+\s*){1,3} #{"Sent from my".reverse}$)|(^(\w+\s*){1,3} #{"Envoyé de mon".reverse}$)/n | |
has a non escaped non ASCII character in non ASCII-8BIT script (RegexpError) |
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
PgSearch.multisearch_options = { | |
:using => { tsearch: { prefix: true } } | |
} | |
module PgSearch | |
class Document < ActiveRecord::Base | |
before_save do | |
self.organization_id = searchable.organization_id | |
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 'rake/testtask' | |
Rake::TestTask.new('test:models' => ['db:test:prepare', 'db:seed']) do |t| | |
t.pattern = 'test/models/**/*_test.rb' | |
end | |
Rake::TestTask.new('test:controllers' => ['db:test:prepare', 'db:seed']) do |t| | |
t.pattern = 'test/controllers/**/*_test.rb' | |
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
# Environment | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path('../../config/environment', __FILE__) | |
# Factories | |
require File.expand_path('../factories', __FILE__) | |
# Minitest | |
require 'minitest/autorun' |
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
ENV['RAILS_ENV'] = 'production' | |
web_path = '/home/deployer/apps/web/current' | |
Bluepill.application('web', :log_file => "#{web_path}/log/bluepill.log") do |app| | |
app.process('unicorn') do |process| | |
process.pid_file = "#{web_path}/tmp/pids/unicorn.pid" | |
process.working_dir = web_path | |
process.start_command = "/usr/local/bin/bundle exec unicorn -D -c #{web_path}/config/unicorn.rb -E #{ENV['RAILS_ENV']}" |
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
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
unless html_tag =~ /^<label/ | |
%{<div class="field-with-errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label> </div>}.html_safe | |
else | |
%{<div class="field-with-errors">#{html_tag}</div>}.html_safe | |
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
Show hidden characters
{ | |
"auto_complete": true, | |
"color_scheme": "Packages/User/Tomorrow-Night-Eighties.tmTheme", | |
"file_exclude_patterns": | |
[ | |
"*.sublime-project", | |
"*.pyc", | |
"*.pyo", | |
"*.exe", | |
"*.dll", |
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
<?php | |
function multi_array_key_exists($needle, $haystack) | |
{ | |
foreach ($haystack as $key => $value) | |
{ | |
if ($needle === $key) | |
{ | |
return $key; | |
} |
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
- Adobe Suite | |
- Adium (Multi IM app) | |
- Antidote | |
- Aperture (Photos management/Photography) | |
- App Cleaner (Delete apps) | |
- Burn (occasional burning) | |
- Colloquy (IRC) | |
- Divvy (Window management) | |
- Dropbox | |
- Droplr |
NewerOlder