Skip to content

Instantly share code, notes, and snippets.

@forgotpw1
forgotpw1 / gist:67398debfa82bb0f820c
Last active August 29, 2015 14:18
Causes for hanging database transactions - Durascope

Any situation which causes a Context object to go out of scope (which can happen if additional context objects are created in the course of the processing) can leave a hanging transaction.

@forgotpw1
forgotpw1 / gist:9d6f0609f3cc44788d3e
Last active August 29, 2015 14:18
Terminate postgres connections for aborted processes.
SELECT pg_terminate_backend(pid)
FROM pg_stat_activity
WHERE datname = 'DB'
AND pid <> pg_backend_pid()
AND state = 'idle in transaction (aborted)'
AND state_change < current_timestamp - INTERVAL '5' MINUTE
(sudo -u postgres pg_ctl stop -D /usr/local/pgsql/data -m i -t 5 || true) && sudo stop postgresql
# start again with
sudo start postgresql
@forgotpw1
forgotpw1 / gist:2a55be5678a27001dac9
Last active August 29, 2015 14:09
Authorize.net Test Credit Card Numbers
For your reference, you can use the following test credit card numbers when testing your connection. The expiration date must be set to the present date or later:
- American Express Test Card: 370000000000002
- Discover Test Card: 6011000000000012
- Visa Test Card: 4007000000027
- Second Visa Test Card: 4012888818888
- MasterCard: 5555555555554444
- JCB: 3088000000000017
- Diners Club/ Carte Blanche: 38000000000006
@forgotpw1
forgotpw1 / gist:7439518
Created November 12, 2013 21:57
Edit text in browser tab
data:text/html, <html contenteditable>
@forgotpw1
forgotpw1 / gist:3103083
Created July 13, 2012 06:19
How many git commits have project contributors made
git shortlog -s -n