Skip to content

Instantly share code, notes, and snippets.

Robbie Vanbrabant robbiev

Block or report user

Report or block robbiev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .config
Host *
ControlPersist yes
ControlMaster auto
ControlPath /tmp/ssh-%r@%h:%p
ServerAliveInterval 60
View flush_dns.sh
case "$(sw_vers -productVersion)" in
10.5.*|10.6.*)
alias flush_dns="sudo dscacheutil -flushcache"
;;
10.8.*|10.7.*)
alias flush_dns="sudo killall -HUP mDNSResponder"
;;
10.9.*)
alias flush_dns="sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder"
;;
@JakeWharton
JakeWharton / Oauth1SigningInterceptor.java
Last active Jan 25, 2020
An OkHttp interceptor which does OAuth1 signing. Requires Guava and Java 8, although those dependencies wouldn't be too hard to break if you didn't have them.
View Oauth1SigningInterceptor.java
/*
* Copyright (C) 2015 Jake Wharton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View gist:9e7ac7185ffd64c1a91a

Preview build: Container grouping and stack composition

NOTE: this is out of date - refer to https://github.com/docker/docker/issues/9694

Here is a preview build of two new features we’re working on concurrently: container grouping (docker groups) and stack composition (docker up). Together, they will eventually form a complete replacement for Fig.

View docker-clean
#!/bin/sh
remove_dangling() {
echo "Removing dangling images ..."
docker rmi $(docker images -f dangling=true -q)
}
remove_stopped_containers() {
echo "Removing stopped containers ..."
docker rm $(docker ps -qa)
@niemeyer
niemeyer / resolve.go
Last active Nov 6, 2015
ResolveTCPAddr with support for timeouts
View resolve.go
package main
import (
"fmt"
"net"
"time"
)
func ResolveTCPAddr(network, addr string, timeout time.Duration) (*net.TCPAddr, error) {
switch network {
View gist:8684718
Things to note
==============
No miracles:
* If you're already getting near the top end of what your ISP advertises then it's unlikely you can get any improvement.
* This only applies to ADSL, not Fibre/Cable
Improve poor connection speed due to noise from internal extension wiring
@substack
substack / dotslashtaskdotjs.markdown
Created Jan 8, 2014
introducing ./task.js, THE new javascript task runner automation framework
View dotslashtaskdotjs.markdown

why ./task.js?

One word: task automation. It's basically zero effort and you can use the ./task.js package manager to handle any repetitive tasks. You can use ./task.js to automate everything with minimum effort.

./task.js provides the structure, order, and authority that you as a developer so desperately crave. ./task.js will also take responsibility for your actions if you need it to. It's what everybody is using now. ./task.js is the new hotness. It's all about ./task.js now, just like that.

This is compared to npm run/bash scripts, which are:

@tbroyer
tbroyer / README.md
Last active May 25, 2016
Error-prone in Gradle
View README.md

UPDATE: This is now available as a plugin https://github.com/tbroyer/gradle-errorprone-plugin

To use it, just add the following to your build.gradle and it'll change all JavaCompile tasks to use the error-prone compiler:

apply from: 'https://gist.github.com/tbroyer/6847494/raw/errorprone.gradle'
@carchrae
carchrae / main.js
Last active Dec 22, 2015
javascript verticle for template rendering with dust.js
View main.js
var vertx = require("vertx.js")
var console = require('vertx/console');
console.log('module ' + JSON.stringify(module));
var dust;
var x = function(){
var module = undefined;
You can’t perform that action at this time.