Skip to content

Instantly share code, notes, and snippets.

View gaganawhad's full-sized avatar

Gagan Awhad gaganawhad

  • Desiring God
  • Minneapolis, MN
View GitHub Profile
@eyeseast
eyeseast / 2019.md
Last active January 1, 2020 03:30
2019 goals
  • Save 20% of our income
  • Take a family vacation
  • Get a nice (professional) family photo taken
  • Get passports for the kids
  • Cook three new things from Marcella Hazan's cookbook, from different chapters (so only one pasta, etc), or from Food Matters, of NYT Cooking
  • Catalog all my email subscriptions and unsubscribe from 75 percent of them
  • Compete in jiujitsu at least once
  • Play at least one game of chess a week

Projects:

@juanca
juanca / github_load_all_diffs.js
Created March 2, 2017 18:42
Github PR bookmarklet: Load all file diffs
javascript:
document.querySelectorAll('.load-diff-button').forEach(node => node.click())
@peterc
peterc / methods_returning.rb
Last active October 29, 2023 03:10
Object#methods_returning - to work out which method on an object returns what we want
require 'stringio'
require 'timeout'
class Object
def methods_returning(expected, *args, &blk)
old_stdout = $>
$> = StringIO.new
methods.select do |meth|
Timeout::timeout(1) { dup.public_send(meth, *args, &blk) == expected rescue false } rescue false
@gaganawhad
gaganawhad / activerecord-cheatsheet.md
Last active September 9, 2022 19:05
This cheatsheet has been moved to Obisidian for now. Don't make edits here!!!!! Cheatsheet for git, rails, unix etc.

Jsonb AR querying:

  • All records where a particular key is present:

    Groupings::Collection.where("document ? 'name'")

    OR

Groupings::Collection.where("document ? :key", {key: 'name'}).