Skip to content

Instantly share code, notes, and snippets.

View mlarraz's full-sized avatar

Matt Larraz mlarraz

View GitHub Profile
@mlarraz
mlarraz / top_committers.rb
Created February 18, 2023 02:33
Find top committers for a file in a git repo
#!/usr/bin/env ruby
require "json"
require "fileutils"
file = ARGV[0]
repo = `git rev-parse --show-toplevel`.strip
path = Dir.pwd.gsub(repo, File.basename(repo))
cache = Dir.home + "/.cache/top_committers/#{path}/#{file}"
:100644 100644 3f9ddafa 7a61fe1f M lang/ruby/.gitignore
:100644 100644 20543da7 17161f52 M lang/ruby/Gemfile
:100644 100644 8008c46b 9fc48c2a M lang/ruby/Manifest
:100755 100755 8fea5656 a09617c3 M lang/ruby/build.sh
:100644 100644 c419ab1e 5a645663 M lang/ruby/lib/avro.rb
:100644 100644 c27c2dc1 e4650557 M lang/ruby/lib/avro/data_file.rb
:100644 100644 9dc41db4 31107217 M lang/ruby/lib/avro/io.rb
:100644 100644 1ac81294 f0816e83 M lang/ruby/lib/avro/ipc.rb
:000000 100644 00000000 e1b219d7 A lang/ruby/lib/avro/logical_types.rb
:100644 100644 6c210e19 9f509dde M lang/ruby/lib/avro/protocol.rb
@mlarraz
mlarraz / previous_changes.rb
Last active June 4, 2016 01:02
Using previous_changes in an after_commit hook
class AddFoos < ActiveRecord::Migration
def change
create_table :foos do |t|
t.string :bar
end
end
end
class Foo < ActiveRecord::Base
after_commit do
@mlarraz
mlarraz / difficulty-of-paradigm-shifts.md
Last active February 4, 2016 04:14 — forked from JoshCheek/difficulty-of-paradigm-shifts.md
The difficulty of paradigm shifts

The difficulty of paradigm shifts

I'm going to create some definitions. And even if they're not what you hold that word or idea to mean, I ask that you set that aside for the moment and choose to let the words mean what I am defining them as.

  • A Model/Paradigm is a set of nouns and the relationships between them.
  • Truth is the congruence between an assertion and a model.
@mlarraz
mlarraz / foo.rb
Created May 28, 2015 06:15
state_machines-activemodel not respecting aliases on initialize
require 'state_machines-activemodel'
class Foo
include ActiveModel::Model
attr_accessor :status
alias_attribute :state, :status
state_machine initial: :new
@mlarraz
mlarraz / keybase.md
Created September 23, 2014 14:15
keybase.md

Keybase proof

I hereby claim:

  • I am mlarraz on github.
  • I am mlarraz (https://keybase.io/mlarraz) on keybase.
  • I have a public key whose fingerprint is 7AEC 3E77 2133 9568 A17C 9387 1F9A 45FB 25ED 25C7

To claim this, I am signing this object: