Skip to content

Instantly share code, notes, and snippets.

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

Christopher Orr orrc

🏴󠁧󠁢󠁳󠁣󠁴󠁿
View GitHub Profile
@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...]
#
@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]}"
@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
@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:

@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:

@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
@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 / {
@benjchristensen
benjchristensen / DebounceBuffer.java
Last active March 1, 2024 15:46
DebounceBuffer: Use publish(), debounce() and buffer() together to capture bursts of events.
import java.util.List;
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.Subscriber;
import rx.schedulers.Schedulers;
public class DebounceBuffer {
public static void main(String args[]) {
@adewes
adewes / README.md
Last active February 13, 2024 16:39
Ebay Ads - Bot. Because who wants to write messages by hand...

To use this bot:

  • Download ads_bot.py and requirements.txt.
  • Type pip install -r requirements.txt to install the requirements.
  • Fill out the required information in the Python file.
  • Ideally, create a (free) Slack account and set up a web hook to receive notifications from the bot.
  • Run the script :)
  • Relax and be ready to answer incoming calls :D
@evelyne24
evelyne24 / TestSubjects.java
Last active July 12, 2016 08:22
`test` *bold*
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.util.Arrays;
import java.util.Collections;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;