Skip to content

Instantly share code, notes, and snippets.

View Qalthos's full-sized avatar
🏳️‍⚧️

Kate Case Qalthos

🏳️‍⚧️
View GitHub Profile
@Qalthos
Qalthos / dep_tree.py
Last active December 21, 2015 11:19
Get detailed dependency information from site packages.
from __future__ import print_function
from pprint import pprint as print
import pip
def get_all_package_dependencies():
"""Return dictionary of installed packages to list of package dependencies."""
return {
dist.key: [(r.key, r.specs) for r in dist.requires()]
for dist in pip.get_installed_distributions()
}
@Qalthos
Qalthos / buzzer.sh
Last active December 18, 2015 18:39
Put somewhere in $PATH and give it the location of buzzer.ogg
#!/bin/bash
vol_perc=$(amixer get Master | egrep -o '[0-9]+%' | head -n 1)
mute=$(amixer get Master | egrep -o '\[off\]' | head -n 1)
amixer -q set Master 100% unmute
mplayer buzzer.ogg
amixer -q set Master $vol_perc $(if [ ! -z $mute ]; then echo 'mute'; fi)
#!/bin/sh
# The user that will run the server
CS_USER=hlds
# Leave this alone.
NAME=srcds
PATH=/bin:/usr/bin:/sbin:/usr/sbin
@Qalthos
Qalthos / Knowledge example
Created August 1, 2012 21:22
Example code for using the newly emancipated Knowledge module
#!/usr/bin/env python2
from sqlalchemy import create_engine
from knowledge.model import Fact, Entity, DBSession, init_model, metadata
def inject_knowledge():
knowledge = DBSession
monster = Entity(u'Monster')
fairy = Entity(u'Fairy')
rjbean = Entity(u'rjbean')
monster[u'color'] = u'Green'
@Qalthos
Qalthos / gist:2992335
Created June 26, 2012 00:37
wiki.sugarlabs.org cursor CSS killer
@-moz-document domain('wiki.sugarlabs.org') {
a {
cursor: pointer !important;
}
}