Skip to content

Instantly share code, notes, and snippets.

View betawax's full-sized avatar

Holger Weis betawax

View GitHub Profile
@betawax
betawax / gist:3172771
Created July 24, 2012 21:27
Rufnummer unterdrücken
*31#<telefonnummer>
@betawax
betawax / gist:3176279
Last active September 20, 2021 13:54
Shebangs
#!/bin/sh
#!/usr/bin/env bash
#!/usr/bin/env ruby
@betawax
betawax / gist:3178862
Created July 25, 2012 21:42
Ruby benchmark
require "benchmark"
puts Benchmark.measure { foobar }
Benchmark.bm do |x|
x.report("foo:") { foo }
x.report("bar:") { bar }
end
@betawax
betawax / gist:3278810
Created August 6, 2012 21:55
Import several SQL dumps
for i in *.sql; do mysql -u root -p < $i; done
@betawax
betawax / gist:3318136
Created August 10, 2012 21:25
Get data that don't exist in another table
SELECT f.id FROM foo f LEFT JOIN bar b ON b.id = f.id WHERE b.id IS NULL;
@betawax
betawax / gist:3428520
Created August 22, 2012 19:17
Canonical link element
<link rel="canonical" href="" />
@betawax
betawax / gist:3760754
Created September 21, 2012 10:10
Apple Smart App Banners
<meta name="apple-itunes-app" content="app-id=" />
@betawax
betawax / gist:3803640
Created September 29, 2012 10:23
Xcode code snippet placeholder
<#placeholder#>
@betawax
betawax / gist:3859315
Created October 9, 2012 14:51
Run genstrings recursively and ignore vendor files
find . -name "Vendor" -prune -o -name "*.m" -print0 | xargs -0 genstrings -o Localization/en.lproj
@betawax
betawax / gist:3905732
Last active November 26, 2018 08:30
Apache HTTP Auth
AuthType Basic
AuthName "Restricted"
AuthUserFile /path/to/.htpasswd
Require valid-user