Skip to content

Instantly share code, notes, and snippets.

#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
@taylor01
taylor01 / gist:5996661
Created July 14, 2013 23:58
Rake DB commands
db:create creates the database for the current env
db:create:all creates the databases for all envs
db:drop drops the database for the current env
db:drop:all drops the databases for all envs
db:migrate runs migrations for the current env that have not run yet
db:migrate:up runs one specific migration
db:migrate:down rolls back one specific migration
db:migrate:status shows current migration status
db:migrate:rollback rolls back the last migration
db:forward advances the current schema version to the next one
@taylor01
taylor01 / gist:6716726
Created September 26, 2013 16:35
Extend Linux Disks in VMWare
1. Extended in VMWare first
2. Boot VM from Unbuntu live CD. Make sure to use Desktop version and not Server
3. Launch GParted from the live CD.
4. Re-arrange/extend partitions.
5. Reboot VM.
@taylor01
taylor01 / gist:8120499
Created December 25, 2013 05:45
Heroku Middleman Configuration with Travis-ci
language: ruby
rvm:
- 2.0.0-p247
script: bundle exec middleman build
deploy:
provider: heroku
api_key:
secure: <secure heroku auth key>

Keybase proof

I hereby claim:

  • I am taylor01 on github.
  • I am taylor01 (https://keybase.io/taylor01) on keybase.
  • I have a public key whose fingerprint is 8079 6CD5 2DAE C450 1D7C 8E49 9EA5 3BD2 AFAF 4AE9

To claim this, I am signing this object:

@taylor01
taylor01 / gist:2cf5a1834ec23fe024b6
Last active August 29, 2015 14:19
teamhendrick.com photo.asp
<%@ Language=VBScript %>
<%
pageTitle = "Photos"
pageName = "photos"
%>
<!--#include file="include/i_header.asp"-->
<!--Content Start - 650 px wide-->
require 'open-uri'
require 'net/http'
(1..1000).each do |n|
uri = URI("http://static.musictoday.com/store/bands/6/product_large/DMAP#{n}.JPG")
request = Net::HTTP.new uri.host
response = request.request_head uri.path
class SalesHistoryImporter
require 'csv'
def import(file)
@filename = File.basename(file)
@file = open(file)
if !check_file_name(file)
return false
end
Visitor Visits visit_observation
"hash_mac" visitor_id visit_id:integer
"location_id" first_seen_at lat:float
"os" last_seen_at lng:float
"manufacturer" max_rssi unc:integer
ipv4 location:array [['lat', 'lng', 'unc'], ['lat', 'lng', 'unc']]
ipv6
ssid
seen_epoch
@taylor01
taylor01 / gist:acd45287f15af7ff71e9c05edbb5803d
Created August 31, 2017 15:44
Postgres Array attribute migration
class AddLocationToVisitObservation < ActiveRecord::Migration[5.1]
def change
add_column :visit_observations, :location, :text, array:true, default: []
end
end