Skip to content

Instantly share code, notes, and snippets.

View BrettMayson's full-sized avatar

BrettMayson

  • Regina, Canada
  • 12:54 (UTC -06:00)
View GitHub Profile
@BrettMayson
BrettMayson / toggle.py
Last active August 29, 2015 14:10
Pause/Play music when headphones are plugged in or out
#Python 2.7
#Requires: xautomation
import subprocess as sp
import time,os
def headphones():
p = sp.Popen(['pactl', 'list','sinks'], stdout=sp.PIPE, stderr=sp.PIPE)
out, err = p.communicate()
out = out.replace("\t","").split("\n")
import random
import urllib2
peopleD = {}
peopleL = []
peopleM = []
pfile = open("santa.txt")
data = pfile.read()
pfile.close()
int left = 3;
int right = 4;
int m = 5;
int tl = 6;
int t = 7;
int tr = 8;
int bl = 9;
int b = 10;
int br = 11;
#!/usr/bin/env python3
import urllib.request
import os
print("Downloading Installer")
url = "http://dl.4players.de/ts/releases/3.1.6/TeamSpeak3-Client-linux_amd64-3.1.6.run"
os.makedirs(os.path.expanduser("~/.teamspeak"))
os.chdir(os.path.expanduser("~/.teamspeak"))
This file has been truncated, but you can view the full file.
travis_fold:start:worker_info
Worker information
hostname: travis-worker-gce-org-prod4-10:4faf29d3-1922-47db-bea8-63c5dc2ae5c9
version: v2.3.0-5-gef7116f https://github.com/travis-ci/worker/tree/ef7116fac34a232b5d8ecfe0eb9d834b0af9705d
instance: testing-gce-73f0580d-8c6a-4025-be24-c56fcdd533d0:travis-ci-python-precise-1449973934
startup: 21.617464657s
travis_fold:end:worker_info
travis_fold:start:system_info
Build system information
Build language: python
@BrettMayson
BrettMayson / convertible.py
Created August 29, 2016 00:21
CAUTION: USE XINPUT TO FIND YOUR DEVICE'S IDS
from gi.repository import Gtk
import os
KEYBOARD = 13
MASTERKEY = 3
TRACKPAD = 10
MASTERTRACK = 2
@BrettMayson
BrettMayson / convertible.py
Created August 29, 2016 00:21
CAUTION: USE XINPUT TO FIND YOUR DEVICE'S IDS
from gi.repository import Gtk
import os
KEYBOARD = 13
MASTERKEY = 3
TRACKPAD = 10
MASTERTRACK = 2
@BrettMayson
BrettMayson / README
Created August 29, 2016 00:23
CAUTION: USE XINPUT TO FIND YOUR DEVICE'S IDS
Use "xinput" to find your device's ids
My output looks like this
Virtual core pointer id=2 [master pointer (3)]
↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
↳ ELAN1200:00 04F3:301A Touchpad id=10 [slave pointer (2)]
↳ FTSC1000:00 2808:5112 id=11 [slave pointer (2)]
Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
{
"date": "Monday, January 1st",
"desc": "One Sentence",
"map": "Altis",
"name": "Mission Template",
"slots": [
{
"name": "Zeus",
"slots": [
{
Commander - Major
Lead Pilot - Captain
Pilots - Lieutenant
Alpha Leader - Lieutenant
Vehicle Driver - Sergeant
Medic - Corporal
Riflemen - Private
Other Squad Leader - Sergeant