Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mmueller
mmueller / bitly.py
Created April 28, 2011 22:52
Command-line bit.ly URL generator (Python)
#!/usr/bin/env python
#
# Copyright 2009 Empeeric LTD. All Rights Reserved.
#
# 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
#
@mmueller
mmueller / nvidia_brightness_watcher.py
Last active August 31, 2016 13:21
This is an ugly-ass hack to temporarily fix a brightness jumping problem with some nvidia-based laptops on Linux, until nvidiabl/nvidia drivers fix the issue. Watches the actual brightness of the display, and when it jumps up past the maximum, resets it to the original desired value.
#!/usr/bin/env python
import os
import time
BACKLIGHT = 'nvidia_backlight'
DELAY = 0.2
def get_value(name):
path = os.path.join('/sys/class/backlight', BACKLIGHT, name)
@mmueller
mmueller / git
Last active July 6, 2022 18:12
This is a bash script that wraps git and lets you implement pre- or post-command hooks that apply to git globally (not per-repository). Out of the box, this script has a post_clone and post_init hook that do the same thing: prompt you to verify that the author information (user.name and user.email) are correct for the given repository -- prevent…
#!/bin/bash
#
# This script wraps git, so install it somewhere such as ~/bin where
# it will be found by your shell before the actual git executable.
set -e
# Extract the command from a git command line
function get_command {
while [[ "$1" =~ ^- ]]; do

Keybase proof

I hereby claim:

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

To claim this, I am signing this object: