Skip to content

Instantly share code, notes, and snippets.

@hyphenPaul
hyphenPaul / .vimrc
Created September 20, 2021 16:03
My ol' vimrc
""" _____ _____ _____ _____ _____
""" /\ \ /\ \ /\ \ /\ \ /\ \
""" /::\____\ /::\ \ /::\____\ /::\ \ /::\ \
""" /:::/ / \:::\ \ /::::| | /::::\ \ /::::\ \
""" /:::/ / \:::\ \ /:::::| | /::::::\ \ /::::::\ \
""" /:::/ / \:::\ \ /::::::| | /:::/\:::\ \ /:::/\:::\ \
""" /:::/____/ \:::\ \ /:::/|::| | /:::/__\:::\ \ /:::/ \:::\ \
""" |::| | /::::\ \ /:::/ |::| | /::::\ \:::\ \ /:::/ \:::\

Keybase proof

I hereby claim:

  • I am hyphenpaul on github.
  • I am seanfentonrz (https://keybase.io/seanfentonrz) on keybase.
  • I have a public key ASAovFNofxa3DryJXPyCzmPRCSFTtKLiVr089BymbvF8dwo

To claim this, I am signing this object:

@hyphenPaul
hyphenPaul / foreign_key_reference.sql
Created July 5, 2018 14:37
Find foreign keys referencing a specific table
SELECT tc.table_schema, tc.constraint_name, tc.table_name, kcu.column_name, ccu.table_name
AS foreign_table_name, ccu.column_name AS foreign_column_name
FROM information_schema.table_constraints tc
JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name
JOIN information_schema.constraint_column_usage ccu ON ccu.constraint_name = tc.constraint_name
WHERE constraint_type = 'FOREIGN KEY'
AND ccu.table_name='my_table_name';
@hyphenPaul
hyphenPaul / store.sql
Last active December 13, 2017 20:21
Build a quick test PostgreSQL store
drop database if exists store;
create database store;
\c store
begin;
create table products(
id serial primary key,
name varchar(200) not null,
created_at timestamp default current_timestamp,
updated_at timestamp default current_timestamp
);
module Weblinc
module Reports
module ProductsMissingCategories
extend MongoCollection
def self.count
collection.find.count
end
def self.log
Standard Loop:
user system total real
test 15-00112-1: 0.010000 0.000000 0.010000 ( 0.009484)
user system total real
test 15-00199-1: 0.010000 0.000000 0.010000 ( 0.013534)
user system total real
test 15-00224-1: 0.040000 0.010000 0.050000 ( 0.052248)
user system total real
test 15-00278-1: 0.000000 0.000000 0.000000 ( 0.000011)

Keybase proof

I hereby claim:

  • I am hyphenPaul on github.
  • I am sfenton (https://keybase.io/sfenton) on keybase.
  • I have a public key whose fingerprint is 7F37 D2F0 F35D 7657 CE61 009B 3374 768A D858 ED60

To claim this, I am signing this object:

class CoolClass < MyService
api CoolClassApi
def service_params
params.slice(
:some_junk
)
end
def to_partial_path
"foo/foo_#{type}"
end
render @foos
def to_param
"#{title}"
end