Skip to content

Instantly share code, notes, and snippets.

View dougo's full-sized avatar

Doug Orleans dougo

View GitHub Profile
dougo / grub.cfg
Last active August 29, 2015 14:16
Config files from a Dell Precision M3800 with Ubuntu 14.04 preinstalled: /boot/grub/grub.cfg, /etc/apt/sources.list, /etc/apt/sources.list.d/trusty-dell.list, /etc/apt/sources.list.d/trusty-oem.list
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
dougo / gist:b7c46082dd84e7161bfa
Created May 3, 2014 17:39
Ten longest non-comment lines of code in JHCore.
irb(main):012:0> puts IO.readlines("/Users/dorleans/Downloads/JHCore-DEV-2.db").select { |l| l.end_with?(";\n") }.reject { |l| l.start_with?('"') }.sort_by(&:length).last(10)
player:notify(tostr(su:left(tostr(j, " ", unit, (j == 1) ? ":" | "s:"), col1), su:right(pcounts[i], col2), su:right(totalp = totalp + pcounts[i], col3), su:right((totalp * 100) / nump, col4), "%", with_objects ? tostr(su:right(ocounts[i], col5), su:right(totalo = totalo + ocounts[i], col6), su:right((totalo * 100) / numo, col7), "%") | ""));
return {@pass(@args), $string_utils, $login, $object_utils, $guest, this.known_player, $nobody, $list_utils, $guest_log, $player_db, $code_utils, $registration_db, $network, $player_class, $wiz_utils, $player_start, $generic_editor, $mail_agent, $new_player_log, $new_player_log.autoregistration_player, $exit, $error, $you, $command_utils, $boot_log, $toad_log};
return {@pass(@args), $object_utils, $jtext, $jtext.paragraph, $list_utils, $command_utils, $string_utils, $code_utils, $no_one, $jtext.title

Keybase proof

I hereby claim:

  • I am dougo on github.
  • I am dougo ( on keybase.
  • I have a public key whose fingerprint is 043E C6C9 8C98 0F33 F205 F2C1 681A FED5 2BD6 77A6

To claim this, I am signing this object:

dougo / gist:5516162
Created May 4, 2013 04:21
Surprising behavior of ActiveRecord's order method. Can't decide if I should file this as a bug on rails/rails, or post to stackoverflow, or just suck it up and write a separate method that does the right thing.
Loading development environment (Rails 4.0.0.rc1)
2.0.0p0 :001 > p =
=> #<Post id: nil, title: nil, text: nil, created_at: nil, updated_at: nil>
2.0.0p0 :002 >
=> #<Comment id: nil, commenter: nil, body: nil, post_id: nil, created_at: nil, updated_at: nil>
2.0.0p0 :003 > p.comments.size
=> 1
2.0.0p0 :004 > p.comments.order(:created_at).size
=> 0