Skip to content

Instantly share code, notes, and snippets.

Damouse damouse

Block or report user

Report or block damouse

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 8-bit Python ANSI Color Tester
"""
Print out the ANSI color codes for testing.
"""
import sys
for i in range(0, 16):
for j in range(0, 16):
code = str(i * 16 + j)
sys.stdout.write(u"\u001b[38;5;" + code + "m " + code.ljust(4))
@damouse
damouse / nginx.conf
Last active Sep 16, 2018
Nginx wss reverse proxy on the back of letsencrypt
View nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile on;
@damouse
damouse / async_bluetoothctl.py
Last active Sep 6, 2018
Bluetoothctl text interface with asyncio in Python3.6
View async_bluetoothctl.py
"""
A hilarious way to avoid writing DBus implementations by hooking into bluetoothd via the text interface
presented by bluetoothctl. You can do anything bluetoothctl can do except see live events.
In my case, I needed simple ability to pair with an Xbox One controller in python 3.6 with asyncio,
and getting dbus set up made my teeth hurt. This implementation is half serious-- its written to back
honest-to-god production software, but I can't in good conscious advise you to ever use it.
Tested with bluez 5.41 and 5.55, python3.6, and ubuntu 16.04. The only dependency is pexpect, which you
can install with:
View Sublime theme
[
{
"class": "title_bar",
"fg": ["background", 255, 255, 255, 0.7],
"bg": ["background", 0, 0, 0, 0.4]
},
{
"class": "title_bar",
"attributes": ["file_dark"],
"bg": ["background", 255, 255, 255, 0.15]
View .dircolors
# Exact Solarized Dark color theme for the color GNU ls utility.
# Designed for dircolors (GNU coreutils) 5.97
#
# This simple theme was simultaneously designed for these terminal color schemes:
# - Solarized dark (best)
# - Solarized light
# - default dark
# - default light
# with a slight optimization for Solarized Dark.
#
@damouse
damouse / ubuntu.sh
Last active Apr 3, 2018
Clean up Ubuntu bloatware and extras.
View ubuntu.sh
# unity
sudo apt-get purge --quiet --assume-yes unity-scope-calculator \
unity-scope-chromiumbookmarks \
unity-scope-colourlovers \
unity-scope-devhelp \
unity-scope-firefoxbookmarks \
unity-scope-manpages \
unity-scope-musicstores \
unity-scope-openclipart \
unity-scope-texdoc \
View planck.c
/* Copyright 2015-2017 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty ofqwerqweasdfzxcv
* GNU General Public License for more details.
View haikunator-adjectives-and-nouns.py
'''
A collection of adjectives and nouns. Useful for generating names with haikunator.
https://github.com/Atrox/haikunatorpy
'''
adjectives = ['aback', 'abaft', 'abandoned', 'abashed', 'aberrant', 'abhorrent', 'abiding', 'abject', 'ablaze', 'able', 'abnormal', 'aboard', 'aboriginal', 'abortive', 'abounding', 'abrasive', 'abrupt', 'absent', 'absorbed', 'absorbing', 'abstracted', 'absurd', 'abundant', 'abusive', 'acceptable', 'accessible', 'accidental', 'accurate', 'acid', 'acidic', 'acoustic', 'acrid', 'actually', 'ad', 'hoc', 'adamant', 'adaptable', 'addicted', 'adhesive', 'adjoining', 'adorable', 'adventurous', 'afraid', 'aggressive', 'agonizing', 'agreeable', 'ahead', 'ajar', 'alcoholic', 'alert', 'alike', 'alive', 'alleged', 'alluring', 'aloof', 'amazing', 'ambiguous', 'ambitious', 'amuck', 'amused', 'amusing', 'ancient', 'angry', 'animated', 'annoyed', 'annoying', 'anxious', 'apathetic', 'aquatic', 'aromatic', 'arrogant', 'ashamed', 'aspiring', 'assorted', 'astonishing', 'attractive', 'auspicious', 'aut
@damouse
damouse / keymapping.h
Last active Dec 15, 2016
Keymapping for qmk_firmware on an OLKB Atomic. From: keyboards/atomic/damouse
View keymapping.h
#include "atomic.h"
/* QWERTY
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | ESCAPE | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP | DEL
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | END |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- ---------------+--------|
* | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | VOL UP| PG UP |
@damouse
damouse / .bashrc
Last active Jun 12, 2018
Personal bashrc, shared and updated among many, many machines running all kinds of OS. Self updating with rcpush and rcpull.
View .bashrc
# Damouse's autoupdateing bash script, with autoupdating and sublime syncing
#
# To install: remove .bashrc, git clone git@github.com:85e8f43913f591e2d0fa.git, and move contents into home directory
#
# Go commands required for GoOracle:
# go get -u golang.org/x/tools/cmd/goimports
# go get -u golang.org/x/tools/cmd/vet
# go get -u golang.org/x/tools/cmd/oracle
# go get -u golang.org/x/tools/cmd/godoc
#
You can’t perform that action at this time.