Skip to content

Instantly share code, notes, and snippets.

View haggaie's full-sized avatar

Haggai Eran haggaie

View GitHub Profile
@copperlight
copperlight / .bashrc
Created August 11, 2016 16:27
Window Subsystem for Linux ssh-agent Configuraton
# ... more above ...
# wsfl bash is not a login shell
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# ssh-agent configuration
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
@emiller
emiller / yoga-auto-rotate
Last active April 22, 2024 15:44
Lenovo Yoga 13 tablet mode / auto rotation script (ubuntu/debian)
#!/bin/bash
#
# yoga-auto-rotate -- ghetto-style tablet mode, with keyboard and all.
#
# Simple little script that will detect an orientation change for a
# Lenovo Yoga 13 (very hackily) and adjust the active display's
# orientation and disable/enable the touchpad as necessary.
#
# The Yoga 13 will emit keycode `e03e` at one second intervals
# when the screen is flipped into tablet mode. Since this keycode
@sunetos
sunetos / gist:1068329
Created July 6, 2011 21:07
Simple Python ID Allocation Pool
__author__ = 'Adam R. Smith'
class IDPool(object):
'''
Create a pool of IDs to allow reuse. The "new_id" function generates the next
valid ID from the previous one. If not given, defaults to incrementing an integer.
'''
def __init__(self, new_id=None):
if new_id is None: new_id = lambda x: x + 1