Skip to content

Instantly share code, notes, and snippets.

View orrc's full-sized avatar
🏴󠁧󠁢󠁳󠁣󠁴󠁿

Christopher Orr orrc

🏴󠁧󠁢󠁳󠁣󠁴󠁿
View GitHub Profile
@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@jberkus
jberkus / gist:6b1bcaf7724dfc2a54f3
Last active January 7, 2024 21:26
Finding Unused Indexes
WITH table_scans as (
SELECT relid,
tables.idx_scan + tables.seq_scan as all_scans,
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes,
pg_relation_size(relid) as table_size
FROM pg_stat_user_tables as tables
),
all_writes as (
SELECT sum(writes) as total_writes
FROM table_scans
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 17, 2024 02:53
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@rtyler
rtyler / gist:3041462
Created July 3, 2012 18:09
Rakefile for puppet-lint in CI
LINT_IGNORES = ['rvm']
namespace :lint do
desc "Check puppet module code style."
task :ci do
begin
require 'puppet-lint'
rescue LoadError
fail 'Cannot load puppet-lint, did you install it?'
end
@evilchili
evilchili / gist:981734
Created May 19, 2011 21:02
a sample post-receive hook that implements automatic branch building
# hook setup
read oldrev newrev refname
job="MyJenkinsJob"
jenkins_url="http://jenkins/job"
jenkins_token="seeeeekrit"
# what branch are we building?
regex='refs/heads/(.*)'
if [[ $refname =~ $regex ]]; then
target_branch="${BASH_REMATCH[1]}"
@evilchili
evilchili / read-repo-config.sh
Created May 19, 2011 20:55
a generic method for storing repo configuration data in git
#!/bin/bash
#
# parse configuration options from a file in the current repository.
# Designed to be invoked from git hook scripts.
#
# Sample usage: toggle automatic branch building, per-branch
#
# config file looks like:
# BranchName=option1[,option2...]
#