I hereby claim:
- I am glv on github.
- I am glv (https://keybase.io/glv) on keybase.
- I have a public key whose fingerprint is 0CF3 D473 4F46 7494 1975 290C DA1F 2F76 9F2F 5496
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| entries.map(&:job).sort_by(&:number).map(&:project).compact.uniq |
| # Put this in your .irbrc, and then type | |
| # "some_object.my_methods" in an IRB session | |
| # for less noisy exploration of what objects | |
| # can do. | |
| class Object | |
| def my_methods | |
| base_object = case self | |
| when Class then Class.new | |
| when Module then Module.new |
| # for background, see http://m.onkey.org/use-index-with-active-record-finders | |
| # and http://twitter.com/#!/dougalcorn/status/4963159878139904 | |
| from = "#{quoted_table_name} USE INDEX(index_activities_on_created_at_and_country_id)" | |
| Activity.from(from).where('created_at >= ? AND country_id = ?', 10.days.ago, 79).all |
| def evolve(generation) | |
| live_neighbor_stats = generation_stats(generation) | |
| live_neighbor_stats[3] + (live_neighbor_stats[2] & generation) | |
| end | |
| def generation_stats(live_cells) | |
| live_cells.each_with_object(Hash.new(0)) {|live_cell, counter| | |
| neighbors(*live_cell).each {|neighbor| counter[neighbor] += 1 } | |
| }.each_with_object(Hash.new {|h,k| h[k] = []}) {|(cell, count), collector| collector[count] << cell} | |
| end |
| require 'active_record' | |
| module ActiveRecord | |
| module Associations | |
| # This fix allows the association extension methods to work when used in combination | |
| # with built-in Arel scoping methods (where, joins, etc.) and *also* with named scopes | |
| # defined on the target class. | |
| class AssociationProxy | |
| def with_scope_with_extensions(*args, &block) |
| # I source this from ~/.bash_profile | |
| # I think I got them from @JEG2 | |
| BUNDLED_COMMANDS="foreman rackup rails rake rspec ruby shotgun spec watchr nesta cap" | |
| ## Functions | |
| bundler-installed() | |
| { | |
| which bundle > /dev/null 2>&1 |
| (spit (nth *command-line-args* 2) | |
| (clojure.string/join "\n" | |
| (sort (clojure.string/split-lines (slurp (nth *command-line-args* 1)))))) |
| Verifying that +glennv is my blockchain ID. https://onename.com/glennv |
| # What is the value of this Ruby expression? | |
| % % % % % | |
| # There's a trailing space, which is important! | |
| # It evaluates to "%". Why? It's equivalent to this: | |
| %|%|% %|%| | |
| # which parses as: |