Skip to content

Instantly share code, notes, and snippets.

@isaacbowen
isaacbowen / deepcat.rb
Last active November 26, 2024 21:51
https://isaacbowen.com/2024/11/11/deepcat [...] Anyway, this script is good for starting with a single markdown file from a GitBook-backed repository, and printing out that file and all of its references, recursively so that you can hand a piece of content to an AI model with all its relevant context.
#!/usr/bin/env ruby
require 'optparse'
require 'set'
require 'uri'
require 'find'
require 'pathname'
# Initialize options
options = {
@isaacbowen
isaacbowen / gist:9a78c0345d565ddac78d70ad12652a47
Created September 24, 2017 22:18
locksmith bdd scratchpad
Given the following shop config:
{...}
And given a product
When I am logged in as isaac@foobar.com
And when I am tagged with "foo"
Then I should be denied access to /products/baz
And I should be granted access to /products/bar
@isaacbowen
isaacbowen / review.md
Last active September 27, 2016 15:30
2016 review
Manager's Rating Self-Assessment
Teamwork Exceeded expectations
Definition:Performed above the high level expected of the role
Achieved expectations consistently
Innovation Achieved expectations
Definition:Performed at the high level expected of the role
Achieved expectations consistently
Results Exceeded expectations
Definition:Performed above the high level expected of the role
Achieved expectations consistently

Performance and Accomplishments

Teamwork:

@isaacbowen
isaacbowen / hack.sh
Last active August 29, 2015 14:05 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#

Keybase proof

I hereby claim:

  • I am isaacbowen on github.
  • I am isaacbowen (https://keybase.io/isaacbowen) on keybase.
  • I have a public key whose fingerprint is 087A 5130 7CDA 79AD 99B5 2B06 2D69 DEDC D06D ED58

To claim this, I am signing this object:

+1 +1

-1 -1

100 100

109 109

1234 1234

syntax on
set nocompatible
set autoindent
set expandtab
set tabstop=2
set shiftwidth=2
@isaacbowen
isaacbowen / desktopography-dl.rb
Created February 8, 2012 23:17
Desktopography downloader
#!/usr/bin/env ruby
# desktopography-dl.rb
# Requires: nokogiri
#
# Downloads /everything/ from a given Desktopography exhibition. Assumes we're on
# something unixy, with mkdir and wget available for use.
require 'open-uri'
guard 'bundler' do
watch('Gemfile')
# Uncomment next line if Gemfile contain `gemspec' command
# watch(/^.+\.gemspec/)
end
guard 'rails' do
watch('Gemfile.lock')
watch(%r{^(config|lib)/.*})
end
@isaacbowen
isaacbowen / distant_counters.rb
Created September 29, 2011 19:06
Updates inverse counter caches when #collection_singular_ids= is called for an object extending ActiveRecord::Base
module DistantCounters
extend ActiveSupport::Concern
included do
reflect_on_all_associations.each do |reflection|
next unless reflection.macro == :has_many and reflection.is_a? ActiveRecord::Reflection::ThroughReflection
next unless reflection.klass.column_names.include? "#{name.underscore.pluralize}_count"
assoc_name = reflection.name.to_s.singularize
redefine_method "#{assoc_name}_ids=" do |ids|