Skip to content

Instantly share code, notes, and snippets.

View indigoviolet's full-sized avatar
🐈

Venky Iyer indigoviolet

🐈
View GitHub Profile
@indigoviolet
indigoviolet / add-github-buttons-to-graphite
Last active October 9, 2024 18:33 — forked from phoebejaffe/add-github-buttons-to-graphite
JS to add Github buttons to Graphite (especially great with Arc Browser Boosts)
function isGraphitePr() {
return window.location.hostname === 'app.graphite.dev' && window.location.pathname.includes('/github/pr/')
}
function makeGithubPrUrl() {
const pieces = window.location.pathname.replace('/github/pr/', '').split('/');
return `https://github.com/${pieces[0]}/${pieces[1]}/pull/${pieces[2].split('/')[0]}/?from=graphite`;
}
// fn determines whether the element should hide itself
@indigoviolet
indigoviolet / date bookmarklet.js
Last active March 1, 2017 02:13 — forked from shanechin1/date bookmarklet.js
PRs updated in last 7 days bookmarklet
javascript: (function(){
var d = new Date();
d.setDate(d.getDate() - 7);
window.location.href="https://github.com/pulls?utf8=✓&q=is%3Aopen+is%3Apr+involves%3Aindigoviolet+sort%3Aupdated-desc+user%3Afinventures+updated%3A>"+d.toISOString().substring(0, 10)
}());
/* I previously used the other comment style, which broke the bookmarklet */
@indigoviolet
indigoviolet / postgres_queries_and_commands.sql
Created November 15, 2016 00:26 — 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%'