Skip to content

Instantly share code, notes, and snippets.

@sc0ttkclark
sc0ttkclark / userscript.js
Created October 7, 2016 15:37
Papertrail JSON formatter (with addStyle fix)
// ==UserScript==
// @name Papertrail JSON formatter
// @namespace https://papertrailapp.com/
// @version 0.1
// @description Format and colorize JSON log messages in Papertrail
// @match https://papertrailapp.com/*events*
// @copyright 2014+, Papertrail (http://wiki.creativecommons.org/Public_domain)
// @grant GM_addStyle
// ==/UserScript==
Wordlist ver 0.732 - EXPECT INCOMPATIBLE CHANGES;
acrobat africa alaska albert albino album
alcohol alex alpha amadeus amanda amazon
america analog animal antenna antonio apollo
april aroma artist aspirin athlete atlas
banana bandit banjo bikini bingo bonus
camera canada carbon casino catalog cinema
citizen cobra comet compact complex context
credit critic crystal culture david delta
dialog diploma doctor domino dragon drama
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@xaviershay
xaviershay / build_frontend.sh
Last active December 24, 2015 20:49
SASS + Coffee + Concatenation in prod
#!/bin/bash
set -exo pipefail
BUILD_ENV=$1
if [ `uname` == 'Darwin' ]; then
OSX=1
JSCOMPRESSOR="yuicompressor --type js"
else
OSX=
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 3, 2024 16:53
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%'
@ngsankha
ngsankha / README.md
Created June 2, 2012 09:08
Creates an archive of tweets as a git repo

This Python script creates a git repo with your tweets. Obviously its limited by Twitter API limitations as you cannot retrieve more than 3200 tweets at a time.

Given the fact that Twitter doesn't give a fuck about our data, you may not find your old tweets ever again. So nothing is better than keeping an archive of tweets as a Git repo.

This is inspired by @holman's tweets repo. But this doesn't have a dependency on Madrox. Just plain Python and Git.

Usage

To create an archive of tweets initiate a git repo in a directory with git init. Then put the script in the directory and execute:

@zefer
zefer / copy-s3-bucket.rb
Created April 4, 2011 11:24
Copy contents of an S3 bucket to a another bucket using an EC2 instance and a simple Ruby script. Useful for transferring large amounts of data and will work across geographic regions.
require 'rubygems'
require 'right_aws'
aws_access_key_id = 'your-access-key'
aws_secret_access_key = 'your-secret-key'
target_bucket = 'your-source-bucket'
destination_bucket = 'your-destination-bucket'
s3 = RightAws::S3Interface.new(aws_access_key_id, aws_secret_access_key)