Event: Central PA Open Source Conference - http://cposc.org/ - October 27th, 2012
Speaker:
Scott Woods
West Arete
scott@westarete.com
http://twitter.com/westarete
| >> d1 = Date.new( 2006, 12, 1 ) | |
| => #<Date: 4908141/2,0,2299161> | |
| >> d2 = Date.new( 2007, 1, 15 ) | |
| => #<Date: 4908231/2,0,2299161> | |
| >> (d1..d2) | |
| => #<Date: 4908141/2,0,2299161>..#<Date: 4908231/2,0,2299161> | |
| >> weekends = [0, 6] | |
| => [0, 6] | |
| >> (d1..d2).each { |i| puts i } | |
| <snip> |
| <?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 ) { |
| <?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" /> |
| #!/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 packages@opscode.com | tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg | |
| apt-get update |
| class A | |
| @counter = 0 | |
| def self.inc | |
| @counter += 1 | |
| end | |
| end |
| sql = %{ | |
| select enumlabel | |
| from pg_enum | |
| where enumtypid = 'company_status'::regtype | |
| order by oid | |
| } | |
| result = ActiveRecord::Base.connection.execute(sql) | |
| result.each do |row| |
| #!/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 |
| #!/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' |
Event: Central PA Open Source Conference - http://cposc.org/ - October 27th, 2012
Speaker:
Scott Woods
West Arete
scott@westarete.com
http://twitter.com/westarete
| #!/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' |