Skip to content

Instantly share code, notes, and snippets.

Ken Collins metaskills

Block or report user

Report or block metaskills

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
searls /
Created May 2, 2014
Creating a USB install disk of OS X Mavericks

Apple has changed how it distributes OS X Mavericks since its initial release in October 2013. This note was written on May 2, 2014. This affects the instructions you'll find online for how to make a bootable OS X installer.

It used to be that when you downloaded OS X from the App Store, the entire 5GB installer was placed in /Applications/Install OS X Now, there is a simple shortcut program placed in /Applications/OS X The app file is immediately removed in the event of an error or a successful post-install launch. When the download succeeds, the app file is launched which brings up the traditional install wizard, but this time mounted to /Volumes/Install OS X Mavericks.

I actually discovered this because if you already have a volume mounted of the same name (which I did, because I was trying to update my existing USB installer), the App Store download promptly fails right after finishing its download.

So if you have an empty disk you'd like to use as an installer that'

searls / gist:a644a89017022912b2c6
Last active Aug 29, 2015
Some thoughts on small teams and headquarters HQs
View gist:a644a89017022912b2c6

This is a simple little note I wrote down when talking to another company owner on the topic of moving a fully distributed team (with some folks in the same city) to a mostly-distributed team with an HQ office in a single city. It's not necessarily useful as general advice beyond that

why thoughtful physical location matters

I often advise clients that are actively focused on improving their teams to either embrace a fully-distributed team or a fully-colocated one, and to avoid other permutations of organization. Patterns that I see a lot:

  • small satellite offices off a large HQ
  • a handful of remote folk off a large HQ
  • n similarly-sized engineering offices
View gist:540999
# encoding: utf-8
require 'odbc'
require 'odbc_utf8'
module ODBC
class Statement
def finished?
View sam.el
(global-set-key (kbd "M-s") 'save-buffer)
(global-set-key (kbd "M-z") 'undo)
(global-set-key (kbd "<escape>") 'hippie-expand)
(set-face-font 'default "-apple-inconsolata-medium-r-normal--13-0-72-72-m-0-iso10646-1")
(add-to-list 'default-frame-alist '(width . 100))
(add-to-list 'default-frame-alist '(height . 45))
(setq-default tab-width 2)
View gist:559402
Setting Up A Local Port Repo:
1) Add this to /opt/local/etc/macports/sources.conf
file:///Users/kencollins/Repositories/ports [nosync]
2) mkdir /Users/kencollins/Repositories/ports
View gist:562465
Topic.columns_hash['written_on'].sql_type # => "datetime"
Topic.columns_hash['bonus_time'].sql_type # => "time"
Topic.columns_hash['last_read'].sql_type # => "date"
Topic.count # => 4
data = Topic.connection.send(:select,"SELECT `topics`.* FROM `topics`")
row = data[0]
row['written_on'] # => 2003-07-16 10:28:11 UTC
row['written_on'].class # => Time
View gist:605209
# result = @client.execute('SELECT 1 AS [one]')
# result.cancel
# result.cancel
write.c:136:tds_put_string converting 17 bytes of "SELECT 1 AS [one]"
write.c:164:tds_put_string wrote 34 bytes
util.c:162:Changed query state from QUERYING to PENDING
net.c:779:Sending packet
View gist:621473
[datetime] => SYBDATETIME
61 1753-01-01T00:00:00.000 y:1753, m:1, d:1 h:0, m:0, s:0 MS:0 tz:1550134876
62 9999-12-31T23:59:59.997 y:9999, m:12, d:31 h:23, m:59, s:59 MS:997 tz:1550134876
63 2010-01-01T12:34:56.123 y:2010, m:1, d:1 h:12, m:34, s:56 MS:123 tz:1744847616
[smalldatetime] => SYBDATETIME4
231 1901-01-01T15:45:00.000Z days:365 minutes:945 (since 1/1/1900, since midnight)
232 2078-06-05T04:20:00.000Z days:65169 minutes:260 "
[datetime2_7] => SYBCHAR
71 0001-01-01T00:00:00.0000000Z 0001-01-01 00:00:00.0000000
View datedebug.rb
Time.utc(1999, 12, 30, 23, 45, 00, 123000).strftime("%L") # => "123"
Time.utc(1999, 12, 30, 23, 45, 00, 123000).strftime("%3N") # => "123" millisecond (3 digits)
Time.utc(1999, 12, 30, 23, 45, 00, 123000).strftime("%6N") # => "123000" microsecond (6 digits)
Time.utc(1999, 12, 30, 23, 45, 00, 123000).strftime("%9N") # => "123000000" nanosecond (9 digits)
Time.utc(1999, 12, 30, 23, 45, 00, 123000).to_f # => 946597500.123
Time.utc(1999, 12, 30, 23, 45, 00, 123000).usec # => 123000
require 'date'
require 'rational'
View query_mysql.rb
ejb-mbp2:activerecord-sqlserver-adapter ebryn$ ruby test/benchmark/query_sqlserver.rb
-- create_table(:test_benchmarks, {:force=>true})
-> 0.0715s
Query Sqlserver
Author: Erik Bryn
Date: October 19, 2010
Summary: Benchmark SQL Server Queries
System Information
You can’t perform that action at this time.