Skip to content

Instantly share code, notes, and snippets.

View mhutter's full-sized avatar
🤘

Manuel Hutter mhutter

🤘
View GitHub Profile
@posener
posener / go-table-driven-tests-parallel.md
Last active July 10, 2024 13:19
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
@frandieguez
frandieguez / speed-up-arch-aur-builds.sh
Created March 27, 2016 19:02
Speed up Archlinux AUR builds: use all cores and disable package compression
#!/usr/bin/env bash
# use all possible cores for subsequent package builds
sed -i 's,#MAKEFLAGS="-j2",MAKEFLAGS="-j$(nproc)",g' /etc/makepkg.conf
# don't compress the packages built here
sed -i "s,PKGEXT='.pkg.tar.xz',PKGEXT='.pkg.tar',g" /etc/makepkg.conf
//
// Base32.swift
// Created by Steve Streza on 26.9.14.
//
import Foundation
func Base32Encode(data: NSData) -> String {
let alphabet = [ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "2", "3", "4", "5", "6", "7"]
return Base32Encode(data, alphabet)
@mhutter
mhutter / lenses.md
Last active August 29, 2015 14:02
Lens Sweetspots

Aperture Sweetspots in regard to Sharpness.

Lens foc. len Sweetspot
Canon EF 50mm f/1.4 USM 50mm 5.6
Canon EF 24-105mm f/4L IS USM 24mm 4.0
Canon EF 24-105mm f/4L IS USM 105mm 8.0
Canon EF 70-200mm f/2.8L IS II USM 70mm 4.0
Canon EF 70-200mm f/2.8L IS II USM 200mm 2.8/8.0
@JPry
JPry / curl.sh
Created December 21, 2012 01:19
Use CURL to request a domain name/path from a specific IP address. Substitute the domain for "example.com", and the IP address and path in the URL.
curl -H "Host: example.com" -I http://IP.ADD.RE.SS/path/to/file/or/folder/
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 5, 2024 22:16 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.