Skip to content

Instantly share code, notes, and snippets.

View hulbert's full-sized avatar
👋

Scott Hulbert hulbert

👋
View GitHub Profile
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active September 19, 2024 05:47
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), 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(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@hulbert
hulbert / twitter-filters.js
Created June 29, 2011 05:33
Javascript functions to filter out replies from Twitter API JSON
// This filters out replies (that Twitter understands are replies)
function has_in_reply_to_status_id(tweet) {
if (tweet.in_reply_to_status_id === null) return false;
else return true;
}
// This filters out tweets that start with a mention, which are almost always replies
function is_user_mention_at_start(tweet) {
if (tweet.entities.user_mentions.length > 0) {
if (tweet.entities.user_mentions[0].indices[0] === 0) return true;
@dbergey
dbergey / gist:464024
Created July 5, 2010 05:01
Demonstrates Safari 5 compositing bug
<style>
body { font: 13px arial; }
p { position: relative; }
p.fixed { background: white; }
object {
float: left;
border: 1px solid red;
margin: 0 10px 10px 0;
width: 200px;
height: 50px;
/*
A Revised Font Stack
from A Way Back
http://www.awayback.com/revised-font-stack/
*/
/*