Skip to content

Instantly share code, notes, and snippets.

View agrimm's full-sized avatar

Andrew Grimm agrimm

  • Terem Technologies
  • Sydney, New South Wales
View GitHub Profile
@agrimm
agrimm / gist:6f8f5e56849a521f58ab
Last active August 29, 2015 14:15
GitHub summary
My GitHub profile
https://github.com/agrimm/rubocop
I contributed new "Cops" to RuboCop. These cops include SpaceBeforeComma, SpaceBeforeSemicolon, and FlipFlop.
I fixed bugs, such as LiteralInCondition not handling a case statement that didn't have a variable following the "case" keyword, and MultilineIfThen not handling an implicit match conditional.
I added functionality to existing cops, by adding the MaxLineLength parameter to the IfUnlessModifier and WhileUntilModifier cops.
https://github.com/agrimm/rubyspec
@agrimm
agrimm / gist:874620c85d7cabe05bfc
Last active August 29, 2015 14:14
RubyConf AU 2015 Itinerary
Tuesday 3 February: JQ517 depart 14:05 Sydney Airport - T2 Domestic, arrive 3:40 pm Melbourne Airport - T1 Domestic
Tuesday 3 February - Sunday 8 February: Elizabeth Hostel 490 - 494 Elizabeth Street, Melbourne
Wednesday 4 February, 9am registration: RubyConfAU workshop. Jasper Hotel, 489 Elizabeth St, Melbourne
Thursday 5 February - Friday 6 February: RubyConfAU conference. Deakin Edge within Fed Square, on the corner of Flinders St and St Kilda Road, Melbourne. Deakin Edge is in the river side of the complex, away from St Kilda Road.
Sunday 8 February: JQ516 depart 1:00 pm Melbourne Airport - T1 Domestic, arrive 2:25 pm Sydney Airport - T2 Domestic
srand 0
WIDTH, HEIGHT = 10, 10
array = Array.new(HEIGHT){ [0]*WIDTH }
require "profile"
10000.times do
y, x = rand(HEIGHT), rand(WIDTH)
g = array[y][x] + [-1,+1].sample
array[y][x] = g unless [[y-1,x],[y+1,x],[y,x-1],[y,x+1]].any?{ |y, x|
@agrimm
agrimm / gist:10719150
Created April 15, 2014 09:57
RubyConfTW 2014 itinerary
Friday 18 April 21:55: Cathay Pacific flight CX138. Depart Kingsford Smith Terminal 1, arrive Hong Kong 05:25. Depart Hong Kong 07:30 on CX496, arrive Taipei Saturday 09:10.
Buy pre-paid SIM card at airport. http://www.taoyuan-airport.com/english/store3_2/1106
19-27 April: Mellow Fields Hotel. English address: No.127, Sec. 7, Zhongshan N. Rd., Shilin Dist., Taipei, Taiwan 11156. Chinese address: 11156 台北市士林區中山北路七段113號 . Phone: +886-2-28752288. https://www.facebook.com/MellowFieldsHotel/
25-26 April: Rubyconf Taiwan. Venue: 陽明大學 / National Yang-Ming University. Address (Chinese/English): 112台北市北投區立農街二段155號 / No.155, Sec.2, Linong Street, Taipei, 112 Taiwan. Phone: 02-28275667.
會場入口位於活動中心 / The venue is at Auditorium and Activity Center in the campus. 搭捷運到石牌站,再步行到會場(路線) / Transfer to the MRT Shipai Station and walk to the venue.
Friday 25 April 19:30: Official Party. Place: 天母黎舍Bar / Tien-Mu 8898 Bar Restaurant. Address: 台北市士林區天母東路78號 / No.78, Tianmu E. Rd., Shilin Dist., Taipei City. Phone: 02-28738898

Given that many(most?) jobs filled are done so via personal/community recommendations, it follows that teams are therefore built from the pool of people who attend events like RoRoSyd or are friends of those people. This creates a monoculture of people who enjoy the type of activity that RoRoSyd is within our workplaces.

To fix this either RoRoSyd must become more diverse, or companies must spend more money locating, recruiting and training more diverse applications. The aspect of this we as a community have control over is RoRoSyd.

RoRoSyd is currently a social event/drinkup instead of a professional networking event. Personally I enjoy RoRoSyd in its current form, but I think it should evolve and part of that means losing the image of a drinkup. Therefore lets leave the pub.

There's no doubt in my mind that our community is more intimidating to newbies and minorities because it's in a pub. We should work to be less intimidating, both to grow our community and to help improve the diversity of our teams at

Which of the Octocats are female?
About a dozen.
http://octodex.github.com/octoliberty/ (specific figure)
http://octodex.github.com/femalecodertocat/
http://octodex.github.com/Mardigrastocat/ (um, no comment)
http://octodex.github.com/Kimonotocat/ (almost certainly an octocat geisha - predominantly female profession these days)
http://octodex.github.com/motherhubbertocat/ (domestic duties)
http://octodex.github.com/twenty-percent-cooler-octocat/
Hi Andrew
We are an international company on the search for the best talent there is out there and we ran into your profile showing you as an outstanding developer with great ruby skills.
We want to show you an opportunity to come here to work with our team for a couple of months while meeting other cultures and enjoy the lifestyle of this beautiful country, or we could also explore the possibility of working remotely with you.
You can read more about us and out work at www.staunchrobots.com and if it sounds interesting to you, feel free to book an appointment via my google calendar [redacted].
# Simplified version of the bug LiteralInCondition detected in my code
def parse_string(string)
case
when string =~ /foo/ then foo
when string =~ /bar/ then bar
when ["a", "b", "c"].include?(string) then baz
# goto fail. Go directly to fail. Do not pass go, do not collect $200.
when /something_else/ then something_else
else fail
end
@agrimm
agrimm / commands_run.txt
Last active January 3, 2016 12:39
Replication of bug in ruby-prof where time taken by a particular child is underestimated
bundle exec ruby-prof --printer=graph --file=graph_slow_search.txt slow_search.rb
ruby --version
ruby 2.2.0dev (2014-01-10 trunk 44549) [x86_64-linux]
########
$ rbenv shell 2.2.0-dev
$ RUBY_PROF_TRACE=/tmp/ruby-prof-trace.txt bundle exec ruby-prof --printer=graph --file=not_used.txt slow_search.rb
$ cd ../sandbox/ruby-prof/
$ ruby bin/ruby-prof-check-trace /tmp/ruby-prof-trace.txt
@agrimm
agrimm / ruby-prof-check-trace 2
Last active January 1, 2016 12:39
New version of Ruby code, with command preceding raising an exception, and ruby-prof-check-trace for the new version.
Note: I couldn't run it using bundle exec, so I had to run it using an unrelated ruby-prof-check-trace file.
LINE 2: return event without call: RubyProf::Profile#start
STACK: []
fixing stack
LINE 3: return event without call: Module#start
STACK: []
fixing stack
LINE 53: return event without call: RubyProfReproduction#throw_rescue_exceptions_method
STACK: ["Kernel#load", "Object#run_the_methods", "RubyProfReproduction#throw_rescue_exceptions_method"]