This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ID=$(xinput list|grep TouchPad|awk '{print $6}'| cut -d= -f 2) | |
STATE=$(xinput list-props ${ID} |grep 'Device Enabled'| awk '{ print $4}') | |
function do_enable() { | |
xinput enable ${ID} | |
killall notify-osd | |
notify-send 'TouchPad enabled' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script rotates the screen and touchscreen input 90 degrees each time it is called, | |
# by Ruben Barkow: https://gist.github.com/rubo77/daa262e0229f6e398766 | |
#### configuration | |
# find your Touchscreen device with `xinput` | |
TouchscreenDevice='ELAN Touchscreen' | |
screenMatrix=$(xinput --list-props "$TouchscreenDevice" | awk '/Coordinate Transformation Matrix/{print $5$6$7$8$9$10$11$12$NF}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NeoBundle 'chrisgillis/vim-bootstrap3-snippets' | |
NeoBundle 'vim-scripts/todo-txt.vim' | |
NeoBundle 'farseer90718/vim-taskwarrior' | |
NeoBundle 'vim-perl/vim-perl' | |
NeoBundle 'scrooloose/syntastic' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postgres: | |
image: postgres:9.4 | |
volumes: | |
- ./init.sql:/docker-entrypoint-initdb.d/init.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""Google Authenticator integration example | |
$ pip install otpauth qrcode pillow | |
""" | |
import qrcode | |
from otpauth import OtpAuth | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postgresql92: | |
image: onjin/alpine-postgres:9.2 | |
volumes: | |
- $HOME/.volumes/postgresql92:/var/lib/postgresql/data | |
postgresql93: | |
image: onjin/alpine-postgres:9.3 | |
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Generate cryptographically strong pseudo-random numbers suitable for | |
managing secrets such as account authentication, tokens, and similar. | |
See PEP 506 for more information. | |
https://www.python.org/dev/peps/pep-0506/ | |
""" | |
__all__ = ['choice', 'randbelow', 'randbits', 'SystemRandom', | |
'token_bytes', 'token_hex', 'token_urlsafe', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABC, ABCMeta, abstractmethod | |
from collections import namedtuple | |
from itertools import count | |
PayloadFactory = namedtuple('PayloadFactory', [ | |
'good', 'created', 'queued', 'unchanged', 'requires_auth', | |
'permission_denied', 'not_found', 'invalid', 'error' | |
]) | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import decimal | |
from functools import total_ordering | |
from numbers import Real | |
class Context(object): | |
def __init__(self, **kwargs): | |
self.context = decimal.Context(**kwargs) | |
def __enter__(self): | |
with decimal.localcontext(self.context) as c: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list all running nginx virtual hosts on docker created using | |
# `https://github.com/jwilder/nginx-proxy` | |
docker inspect --format '{{ index (index .Config.Env) 1 }}' $(docker ps -q) | grep VIRTUAL_HOST | cut -d\= -f 2 |