Skip to content

Instantly share code, notes, and snippets.

@jhjwind
jhjwind / postgres_queries_and_commands.sql
Created September 26, 2017 21:54 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@jhjwind
jhjwind / gist:543d3a7c19369c257054d3216a9572e2
Created March 21, 2017 03:52 — forked from voidfiles/gist:2860137
Get Pocket Bookmarklet
// The Bookmarklet
javascript: (function() %
7BISRIL_H = '8e7a';
PKT_D = 'getpocket.com';
ISRIL_SCRIPT = document.createElement('SCRIPT');
ISRIL_SCRIPT.type = 'text/javascript';
ISRIL_SCRIPT.src = 'http://' + PKT_D + '/b/r.js';
document.getElementsByTagName('head') % 5B0 % 5D.appendChild(ISRIL_SCRIPT) % 7D)();
@jhjwind
jhjwind / gist:c25be1993fc2e17c48c5e51aa341b6be
Created March 21, 2017 03:52 — forked from voidfiles/gist:2860137
Get Pocket Bookmarklet
// The Bookmarklet
javascript: (function() %
7BISRIL_H = '8e7a';
PKT_D = 'getpocket.com';
ISRIL_SCRIPT = document.createElement('SCRIPT');
ISRIL_SCRIPT.type = 'text/javascript';
ISRIL_SCRIPT.src = 'http://' + PKT_D + '/b/r.js';
document.getElementsByTagName('head') % 5B0 % 5D.appendChild(ISRIL_SCRIPT) % 7D)();
@jhjwind
jhjwind / ladder.md
Created January 17, 2017 23:10 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@jhjwind
jhjwind / Readm.md
Created November 30, 2016 04:54 — forked from jeroenvandijk/Readm.md
Instructions to test Logstash with Kafka

Test Logstash with Kafka

Setup Kafka

Download Kafka from:

https://www.apache.org/dyn/closer.cgi/incubator/kafka/kafka-0.7.2-incubating/kafka-0.7.2-incubating-src.tgz

Install Kafka

@jhjwind
jhjwind / rvm2rbenv.txt
Created November 19, 2016 22:48 — forked from brentertz/rvm2rbenv.txt
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
06/2016 OR 08/2018 737 7373
@jhjwind
jhjwind / script
Last active August 29, 2015 14:22
Profile model deprecation plan
#Step 1
heroku run rake db:migrate
#step 2
heroku run rake profiles_to_companies:move_active
heroku run rake profiles_to_companies:move_inactive
heroku run rake remove_profile:migrate_profile
#step 3
heroku run rake remove_profile:migrate_seats
@jhjwind
jhjwind / gist:c3ee55a38fc90cd953c2
Created April 1, 2015 20:05
postgres finding missing index
SELECT relname, seq_scan-idx_scan AS too_much_seq, case when seq_scan-idx_scan>0 THEN 'Missing Index?' ELSE 'OK' END, pg_relation_size(relname::regclass) AS rel_size, seq_scan, idx_scan
FROM pg_stat_all_tables
WHERE schemaname='public' AND pg_relation_size(relname::regclass)>80000 ORDER BY too_much_seq DESC;

Set up a Spree backend only install

rails new store-backend

Gemfile

gem 'spree_backend', github: 'spree/spree'