Skip to content

Instantly share code, notes, and snippets.

View uweschaefer's full-sized avatar

Uwe Schaefer uweschaefer

View GitHub Profile
@gnarf
gnarf / ..git-pr.md
Last active May 7, 2026 13:08
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@kofemann
kofemann / GuavaCacheMXBean.java
Created September 25, 2013 16:12
Expose Google's guava Cache vie JMX
public interface GuavaCacheMXBean {
public long getRequestCount();
public long getHitCount();
public double getHitRate();
public long getMissCount();
@robbyt
robbyt / raring-heart.txt
Created April 11, 2014 21:18
Heartbleed fix - rebuild openssl for Ubuntu Raring 13.04
#!/bin/bash
mkdir sslfix
cd sslfix
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.0.1e-3ubuntu1.2.dsc
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.0.1e.orig.tar.gz
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.0.1e-3ubuntu1.2.debian.tar.gz
sudo apt-get build-dep openssl
dpkg-source -x openssl_1.0.1e-3ubuntu1.2.dsc
@staltz
staltz / introrx.md
Last active August 6, 2026 06:30
The introduction to Reactive Programming you've been missing
#!/usr/bin/ruby
require 'json'
DESC_HEAD = /^\.([^\.\[]+)/
DEREF_HEAD = /^\[(\d+)\]/
def usage
$stderr.puts <<USAGE
usage: json descriptor
anonymous
anonymous / gist:3207d6eefa07cd21e68e
Created June 30, 2015 09:52
List branches sorted by last activity date
alias gbr='git for-each-ref --sort="-authordate:iso8601" --format=" %(color:green)%(authordate:iso8601)%09%(color:white)%(refname:short)" refs/heads'
@vancluever
vancluever / gnome-tracker-disable.md
Last active August 7, 2026 11:05
GNOME Tracker Disable

Disabling GNOME Tracker and Other Info

GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/

After discovering it chowing 2 cores, I decided to go about disabling it.

Directories

@dlew
dlew / File.java
Created March 1, 2016 20:46
Automated onError() message generation
public static Action1<Throwable> crashOnError() {
final Throwable checkpoint = new Throwable();
return throwable -> {
StackTraceElement[] stackTrace = checkpoint.getStackTrace();
StackTraceElement element = stackTrace[1]; // First element after `crashOnError()`
String msg = String.format("onError() crash from subscribe() in %s.%s(%s:%s)",
element.getClassName(),
element.getMethodName(),
element.getFileName(),
element.getLineNumber());
@jthomerson
jthomerson / delete-all-cloudsearch-documents.sh
Created April 24, 2017 14:50
Delete all CloudSearch documents in a given domain
#!/bin/bash
# This script will delete *all* documents in a CloudSearch domain.
# USE WITH EXTREME CAUTION
# Note: depends on the AWS CLI SDK being installed, as well as jq
# For jq, see: https://stedolan.github.io/jq/ and https://jqplay.org/
if [[ ! $# -eq 2 || $1 != "--doc-domain" || ! $2 =~ ^https://.*$ ]]; then
echo "Must define --doc-domain argument (e.g. --doc-domain https://somedomain.aws.com)";