Skip to content

Instantly share code, notes, and snippets.

View parasquid's full-sized avatar

Tristan parasquid

View GitHub Profile
@parasquid
parasquid / console_output
Last active August 29, 2015 14:04
Sync the production branch with the master branch before deployment
tristan@tristan-vbox ~/Sites/lightbringer $ cap production deploy
INFO [8ec98abf] Running /usr/bin/env git checkout master on
DEBUG [8ec98abf] Command: ( RAILS_ENV=production /usr/bin/env git checkout master )
DEBUG [8ec98abf] Already on 'master'
INFO [8ec98abf] Finished in 0.168 seconds with exit status 0 (successful).
INFO [61300fdb] Running /usr/bin/env git pull origin master on
DEBUG [61300fdb] Command: ( RAILS_ENV=production /usr/bin/env git pull origin master )
DEBUG [61300fdb] Already up-to-date.
DEBUG [61300fdb] From github.com:mindvalley/lightbringer
DEBUG [61300fdb] * branch master -> FETCH_HEAD
@parasquid
parasquid / gist:7aaa1c365f1f11b001b6
Last active August 29, 2015 14:06
trust local postgres connections
sed -i 's/local all postgres peer/local all all peer/' /etc/postgresql/9.3/main/pg_hba.conf
sed -i 's/host all all 127.0.0.1\/32 md5/host all all 127.0.0.1\/32 trust/' /etc/postgresql/9.3/main/pg_hba.conf
/etc/init.d/postgresql restart
@parasquid
parasquid / gist:49d889f43abdfab3f78f
Last active August 29, 2015 14:09
Go Pro indefinite video recording
# locks exposure
t ia2 -exp lock 1
# enable USB Mass Storage Device
sleep 1
t app usb msc
# records video
sleep 4
t app button shutter PR
@parasquid
parasquid / order_lines_from_united_states_query.rb
Last active August 29, 2015 14:24
A good query object template
class OrderLinesFromUnitedStatesQuery
class << self
delegate :call, to: :new
end
def initialize(relation = OrderLine.all)
@relation = relation
end
def call
@parasquid
parasquid / gist:9d246193bfdf87a935b4
Last active December 3, 2015 04:29
Sublime Text 2 User Settings
{
"caret_extra_bottom": 1,
"caret_extra_top": 1,
"caret_extra_width": 2,
"color_scheme": "Packages/Color Scheme - Default/Dawn.tmTheme",
"copy_with_empty_selection": false,
"default_line_ending": "unix",
"drag_text": false,
"font_face": "Consolas",
"font_size": 12,
# config/environments/development.rb
Hello::Application.configure do
# ...
# https://rails.lighthouseapp.com/projects/8994/tickets/4676-reload-routes-on-each-request-in-dev-mode
service_reloader = ActiveSupport::FileUpdateChecker.new(Dir["app/services/**"]) { Rails.application.reload_routes! }
config.to_prepare do
service_reloader.execute_if_updated
# Seek&Destroy: Sample Bot
#
# Enjoys following and target and firing many shots
class SeekAndDestroy < RTanque::Bot::Brain
NAME = 'Jimmy'
include RTanque::Bot::BrainHelper
TURRET_FIRE_RANGE = RTanque::Heading::ONE_DEGREE * 5.0
def tick!
set :max_asset_age, 2 ## Set asset age in minutes to test modified date against.
after "deploy:finalize_update", "deploy:assets:determine_modified_assets", "deploy:assets:conditionally_precompile"
namespace :deploy do
namespace :assets do
desc "Figure out modified assets."
task :determine_modified_assets, :roles => assets_role, :except => { :no_release => true } do
set :updated_assets, capture("find #{latest_release}/app/assets -type d -name .git -prune -o -mmin -#{max_asset_age} -type f -print", :except => { :no_release => true }).split
@parasquid
parasquid / README.md
Last active December 17, 2015 14:29 — forked from sfate/README.md
Install ruby-2.0.0-p195 on a Ubuntu 12.04 production server using checkinstall

Installs ruby-2.0.0-p247 on ubuntu via checkinstall so it's in your package manager and you can remove it.

Quick install:

curl -Lo- https://gist.github.com/parasquid/5624732/raw/install-ruby-2-ubuntu.sh | bash

To Design or Not To Design? A Third Good Question

Following my earlier discussions of testing and defect fixing, I’ll complete the trilogy by discussing the role of design early in projects. Recall the context: projects that have validated a genuine need by haven’t validated an economic proposition. Because of the uncertainties of such a situation, iteration is inevitable. Piloting a project on the runway you will like have to try many experiments to find value customers will buy. Capital efficiency while iterating extends the lifespan of the project and increases its chances of success. The more experiments you can perform per dollar, the higher your expected return.

Review

In the sibling essays to this one I argued that the Extreme Programming principles of Test Until Bored and Defects Zero were perfectly appropriate to the cruise phase of a product, where the business driver is increasing profit by lowering cost. These principles also serve to prepare the software to act as a platform from which to