Skip to content

Instantly share code, notes, and snippets.

@nethad
nethad / intercom-copy-notes.js
Last active January 11, 2024 15:33
Intercom Copy/Delete Notes Tampermonkey script
// ==UserScript==
// @name Intercom Copy Notes
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://app.intercom.com/*
// @icon https://www.google.com/s2/favicons?domain=intercom.com
// @grant none
// ==/UserScript==
require "minitest/autorun"
require "minitest/pride"
################################################################################
# Tests
#
# You are NOT allowed to change the tests, the only thing you are
# allowed to change are removing the "skip" calls.
#

ActiveRecord Cheat Sheet

Where clause with joins

# bad: strings in where clause
Contract.joins(:user, :project) \
  .where("users.active = :active AND assignments.active = :active", active: true) \
  .references(:users, :assignments)
@nethad
nethad / keybase.md
Created October 29, 2014 11:06
keybase.md

Keybase proof

I hereby claim:

  • I am nethad on github.
  • I am nethad (https://keybase.io/nethad) on keybase.
  • I have a public key whose fingerprint is A9A0 4CA6 4453 8334 A414 3EEE 13C5 073A 155C D8A1

To claim this, I am signing this object:

@nethad
nethad / binding-pry.sh
Last active December 29, 2015 13:09
git pre-commit hook for illegal code lines
# git-hooks/pre-commit/binding-pry.sh
FOCUS_FILES=`git diff-index --cached --name-only HEAD | xargs grep 'binding.pry' | wc -l`
if [ $FOCUS_FILES -gt 0 ]
then
echo "[pre-commit] You have at least 1 file with a 'binding.pry' call, please remove first."
exit 1
fi