Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mhberger on github.
  • I am mhberger (https://keybase.io/mhberger) on keybase.
  • I have a public key ASBoA0bgZLLNmGxxa4VH7qx4piBkMSJo6Ybw146kHUnLOQo

To claim this, I am signing this object:

@mhberger
mhberger / tot.sh
Last active March 29, 2020 02:06 — forked from gruber/tot.sh
A shell script for Tot
#!/bin/bash
# Fork of CHOCK's original tot.sh to add support for dot "0" to target
# the first empty dot.
# https://gist.github.com/chockenberry/d33ef5b6e6da4a3e4aa9b07b093d3c23
#
# 2 Mar 2020
# + Incorporated suggestions from ShellCheck (https://www.shellcheck.net).
# Thanks to Ramsey Dow.
# + Changed call to `python` to `/usr/bin/python` to get Python 2, avoiding
@mhberger
mhberger / gist:1eeafa6622979829fc8103f1adf806ec
Last active July 5, 2019 03:55 — forked from steipete/ios-xcode-device-support.sh
Using iOS 12.2 devices with Xcode 10.1
// The trick is to link the DeviceSupport folder from the beta to the stable version.
// Updated on Feb 15th, 2019 for Xcode 10.1
// For beta
ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/12.2\ \(16E5191d\) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
// For stable and Xcode 10.1 installed at /Applications/Xcode\ 10.1.app
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/12.2\ \(16E226\) /Applications/Xcode\ 10.1.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
@mhberger
mhberger / mbp_notes.md
Last active August 29, 2015 14:21
Comparison of MacBook Pro Retina 15 inch
Test/Spec mbp 2012 mbp 2015 mbp 2015 - [[1]] mbp 2015 – [[2]]
blackmagic read 446 MB/s 1844 MB/s 1753 MB/s
blackmagic write 432 MB/s 1494 MB/s 1506 MB/s
geekbench single core 3306 3954 3490 3953
geekbench multi core 12744 15396 13402 15143
cinebench cpu 507 cb 617 cb 509 cb 619 cb
cinebench opengl 50.11 fps 62.78 fps 52.85 fps 65.77 fps
unigine heaven 14.8 fps 35.3 fps 35.5 fps
fotomagico export 21:54-20:20 = 94 min 10:45-9:43 = 6
@mhberger
mhberger / truth.groovy
Last active April 2, 2019 09:58
Groovy Truth
// based on http://groovy.329449.n5.nabble.com/String-isEmpty-tp346469p346472.html
assert !(0 as char)
assert (1 as char)
assert !0
assert 1
assert !0.0
@mhberger
mhberger / setSkypeStatus.sh
Last active November 9, 2017 12:52
Set skype status using command line.
#!/usr/bin/env bash
STATUS=$1
if [ -z "$STATUS" ] ; then echo "usage $0 [ONLINE|AWAY]" ; exit; fi
(cat <<EOF
tell application "Skype"
send command "SET USERSTATUS ${STATUS}" script name "Set Skype Status"
end tell
@mhberger
mhberger / gist:97cbacbe76976f65196f
Created February 5, 2015 10:45
drdrang (Leancrew.com) counting-heads done in ruby
#!/usr/bin/env ruby
# See http://leancrew.com/all-this/2015/02/counting-heads/
#
# Eight people are sitting around a circular table. Each has a coin. They all
# flip their coins. What is the probability that no two adjacent people will
# get heads?
rounds = []
(0..255).each { |i|
@mhberger
mhberger / gist:d49733e793c3d1e94329
Last active August 29, 2015 14:14
drdrang (Leancrew.com) counting-heads done in Groovy
#!/usr/bin/env groovy
// See http://leancrew.com/all-this/2015/02/counting-heads/
// Eight people are sitting around a circular table. Each has a coin. They all
// flip their coins. What is the probability that no two adjacent people will
// get heads?
rounds = []
(0..255).each {
@mhberger
mhberger / checkpoint.sh
Last active December 27, 2015 16:09 — forked from bubenkoff/checkpoint.sh
#!/bin/bash
#
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just
# from time to time
# Usage: checkpoint.sh load|unload
# You will need sudo power, of course
#
COMMAND=$1