Event: Central PA Open Source Conference - http://cposc.org/ - October 27th, 2012
Speaker:
Scott Woods
West Arete
[email protected]
http://twitter.com/westarete
require 'component/component_spec_helper' | |
describe "Routing", type: :routing do | |
describe "for the home page" do | |
specify {{ get: '/' }.should route_to('lists#index') } | |
end | |
describe "for authentication" do | |
specify {{ get: '/auth/new' }.should route_to('sessions#new') } | |
specify {{ get: '/auth/37signals/callback' }.should route_to('sessions#create', provider: '37signals') } | |
specify {{ get: '/auth/failure' }.should route_to('sessions#failure') } |
#!/opt/ruby/bin/ruby | |
# This script will clean out old capistrano releases from a set of | |
# subdirectories, but will keep a minimum number. It's designed to be run as | |
# a cron job. | |
# | |
# (c) Copyright 2008 West Arete Computing, Inc. | |
require 'thread' | |
require 'fileutils' |
Event: Central PA Open Source Conference - http://cposc.org/ - October 27th, 2012
Speaker:
Scott Woods
West Arete
[email protected]
http://twitter.com/westarete
#!/bin/bash | |
# | |
# Scott Woods's custom bash prompt. | |
# | |
# Load this file by adding the following to the bottom of your ~/.bashrc: | |
# | |
# function prompt_command { | |
# export PS1=$(~/.prompt.bash) | |
# } | |
# export PROMPT_COMMAND='export LAST_RETURN_VALUE=$? ; prompt_command' |
#!/bin/bash | |
# | |
# Enable TRIM support for 3rd Party SSDs. Works for Mountain Lion | |
# | |
# Source: http://digitaldj.net/2011/07/21/trim-enabler-for-lion/ | |
set -e | |
set -x | |
# Back up the file we're patching |
sql = %{ | |
select enumlabel | |
from pg_enum | |
where enumtypid = 'company_status'::regtype | |
order by oid | |
} | |
result = ActiveRecord::Base.connection.execute(sql) | |
result.each do |row| |
class A | |
@counter = 0 | |
def self.inc | |
@counter += 1 | |
end | |
end |
#!/bin/bash | |
set -e # Exit on error | |
set -x # Print each command | |
# Set up the OpsCode repository | |
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | tee /etc/apt/sources.list.d/opscode.list | |
gpg --keyserver keys.gnupg.net --recv-keys 83EF826A | |
gpg --export [email protected] | tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg | |
apt-get update |
<?xml version="1.0" encoding="UTF-8"?> | |
<scheme name="Twilighted" version="1" parent_scheme="Default"> | |
<option name="LINE_SPACING" value="1.2" /> | |
<option name="EDITOR_FONT_SIZE" value="12" /> | |
<option name="EDITOR_FONT_NAME" value="Monaco" /> | |
<colors> | |
<option name="ANNOTATIONS_COLOR" value="3e83e7" /> | |
<option name="CARET_COLOR" value="ffff99" /> | |
<option name="CARET_ROW_COLOR" value="" /> | |
<option name="CONSOLE_BACKGROUND_KEY" value="1a1a1a" /> |
<?php | |
if ( array_key_exists('sname', $_REQUEST) ) { | |
session_name($_REQUEST['sname']); | |
} | |
session_start(); | |
$messages = ""; | |
function show( $str ) { global $messages; $messages .= $str; } | |
function show_sess_vars() { | |
foreach ( $_SESSION as $key => $val ) { |