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
docker% make docs | |
/Library/Developer/CommandLineTools/usr/bin/make -C docs docs | |
docker build -t "docs-base:15058-include-name-in-syslog-tag" . | |
Sending build context to Docker daemon 7.074 MB | |
Sending build context to Docker daemon | |
Step 0 : FROM docs/base:latest | |
---> 1621828e3ad8 | |
Step 1 : MAINTAINER Mary Anthony <mary@docker.com> (@moxiegirl) | |
---> Using cache | |
---> f131e0f60e41 |
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
MAPPINGS = { | |
# format: "COMMON MISTAKE" => "DESIRED STATE SYMBOL" | |
"OHIO" => "OH", | |
"CALI" => "CA", | |
"CALIFORNIA" => "CA" | |
# and so on... | |
} | |
STATES = MAPPINGS.values.uniq # or possibly explicitly defined: %w(OH, CA, ...) |
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
using terms from application "Mail" | |
on perform mail action with messages theSelectedMessages for rule theRule | |
repeat with theMessageNum from 1 to count theSelectedMessages | |
set theMessage to theSelectedMessages's item theMessageNum | |
if theMessage's source contains "Content-Type: text/calendar" then | |
set mailbox of theMessage to mailbox "Calendar Invites" of account "my_account" | |
end if | |
end repeat | |
end perform mail action with messages | |
end using terms from |
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
#!/bin/bash | |
# Basic Config | |
certs_dir='certs' | |
num_bits=2048 | |
serial_num=01 | |
ca_name='ca' | |
server_name='server' | |
echo '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%' | |
echo '%% Creating Directory to hold Certs %%' |
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
AppRunway::Application.routes.draw do | |
constraints(:subdomain => "") do | |
devise_for :users do | |
get "/login" => "devise/sessions#new" | |
delete "/logout" => "devise/sessions#destroy" | |
end | |
resources :users do | |
resources :apps do | |
resources :emails, only: [:index] |
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
# Based off of this stack overflow answer, but has a nicer output | |
# http://stackoverflow.com/questions/5218902/tail-production-log-with-capistrano-how-to-stop-it | |
# | |
# Set max_hostname_length and tag to whatever you wish. I currently have it for pretty EC2 output | |
desc "tail log files" | |
task :logs, :roles => ENV['ROLE'] || :web do | |
last_host = "" | |
max_hostname_length=19 | |
run "tail -f #{shared_path}/log/#{rails_env}.log" do |channel, stream, 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
# Have `cap deploy` ask for tag to deploy from. Can be automated like this `cap deploy TAG=some-tag-name` | |
set :branch do | |
if ENV['REF'] # Tag passed in via arg | |
ref = ENV['REF'] | |
else # Prompt for reference to use | |
default_ref = `git tag`.split("\n").last | |
ref = Capistrano::CLI.ui.ask "Tag to deploy (make sure repo is up to date): [#{default_ref}] " | |
ref = default_ref if ref.empty? |
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
# Based off of https://gist.github.com/1115513 | |
desc "Remote console on the production appserver" | |
task :console, :roles => ENV['ROLE'] || :web do | |
hostname = find_servers_for_task(current_task).first | |
puts "Connecting to #{hostname}" | |
exec "ssh -l #{user} #{hostname} -t 'source ~/.profile && cd #{current_path} && bundle exec rails c #{rails_env}'" | |
end |
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
URL="https://prosearch-alpha.identified.com/api/prospects/search?page=1&experience=0&first_degree=true&second_degree=true&sort_filter=score&third_degree=true&within=25" | |
while true; do | |
curl -b cookies.txt $URL -o out | |
done |
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 models | |
Module.constants.inject([]) do |models, k| | |
klass = Kernel.const_get k | |
models << klass if klass.respond_to? :ancestors and klass.ancestors.include? ActiveRecord::Base | |
models | |
end | |
end |
OlderNewer