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
class AppDelegate | |
include BW::KVO | |
attr_accessor :user | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.applicationFrame) | |
@window.makeKeyAndVisible |
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 'spec_helper' | |
describe ReportsMailer do | |
describe 'sending a report' do | |
let(:user) { build(:user) } | |
let(:report_mailing) { build(:report_mailing_with_contact) } | |
describe 'sends the PDF report to the selected contacts' do | |
let(:email) { ReportsMailer.visit_report(report_mailing, user, false) } |
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 | |
# Pass in the name of the site you wich to create a cert for | |
domain_name = ARGV[0] | |
if domain_name == nil | |
puts "Y U No give me a domain name?" | |
else | |
system "openssl genrsa -out #{domain_name}.key 1024" | |
system "openssl req -new -key #{domain_name}.key -out #{domain_name}.csr -subj '/C=US/ST=NJ/L=Monroe/O=MyCompany/OU=IT/CN=#{domain_name}'" |
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
daemon off; | |
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/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
# By Henrik Nyh <http://henrik.nyh.se> 2008-01-30. | |
# Free to modify and redistribute with credit. | |
# modified by Dave Nolan <http://textgoeshere.org.uk> 2008-02-06 | |
# Ellipsis appended to text of last HTML node | |
# Ellipsis inserted after final word break | |
# modified by Mark Dickson <mark@sitesteaders.com> 2008-12-18 | |
# Option to truncate to last full word | |
# Option to include a 'more' link |
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
export BREW_HOME=/usr/local | |
brew install libxml2 | |
brew link libxml2 | |
brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/libxslt.rb | |
brew link libxslt | |
brew install libiconv | |
brew link libiconv | |
gem install nokogiri -- --with-xml2-dir=$BREW_HOME/Cellar/libxml2/2.7.8 --with-xslt-dir=$BREW_HOME/Cellar/libxslt/1.1.26 --with-iconv-dir=$BREW_HOME/Cellar/libiconv/1.13.1/ |
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
module Capybara | |
class Session | |
def has_path?(path) | |
synchronize do | |
current_path == path or raise Capybara::ExpectationNotMet | |
end | |
end | |
def synchronize(seconds=Capybara.default_wait_time) | |
start_time = Time.now |
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
class Hash | |
def intersect_by_keys(another_hash) | |
delete_if {|k, v| !another_hash.has_key?(k) } | |
end | |
end | |
{a: 'one', b: 'two'}.intersect_by_keys({a: 'three', d: 'four'}) #=> {:a=>"one"} |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.define :dokku do |dokku| | |
dokku.vm.box = "raring64" | |
dokku.vm.box_url = "http://cloud-images.ubuntu.com/raring/current/raring-server-cloudimg-vagrant-amd64-disk1.box" | |
dokku.vm.network :private_network, ip: "192.168.33.10" | |
dokku.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--memory", "1024"] |
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 this in the project directory | |
rvm env . -- --env > .powenv |
OlderNewer