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
def str_base(number, base): | |
div, mod = divmod(number, len(base)) | |
if div > 0: | |
return str_base(div, base) + base[mod] | |
return base[mod] |
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
# Default locations | |
set cache_home = @(echo $XDG_CACHE_HOME)@ | |
set config_home = @(echo $XDG_CONFIG_HOME)@ | |
set data_home = @(echo $XDG_DATA_HOME)@ | |
set prefix = @(echo $PREFIX)@ | |
set scripts_dir = @data_home/uzbl:@prefix/share/uzbl/examples/data:scripts | |
# Default variables | |
set default_mode = insert | |
set fifo_dir = /tmp |
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
KERNEL!="sd[b-z][0-9]", GOTO="automount_end" | |
# Import FS infos | |
IMPORT{program}="/sbin/blkid -o udev -p %N" | |
# Get a label if present, otherwise specify one | |
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}" | |
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k" | |
# Global mount options |
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 marshmallow.fields import Nested as BaseNested | |
class Nested(BaseNested): | |
"""An overloaded Nested field that can handle more than a single schema. | |
By giving it a list of schemas, it will iterate through them to find one | |
that matches with the input data. It raises an error if the data doesn't | |
correspond to any schema. | |
""" |
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 | |
# Collect DBUS_SESSION_BUS_ADDRESS from running process | |
function set_dbus_adress | |
{ | |
USER=$1 | |
PROCESS=$2 | |
PID=`pgrep -o -u $USER $PROCESS` | |
ENVIRON=/proc/$PID/environ |
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/sh | |
DAEMON="/home/et/etded" | |
DAEMON_OPT="+set net_port 27960 +set fs_game etpro +exec server" | |
DAEMON_USER="et" | |
DAEMON_NAME="etded.x86" | |
DAEMON_DESC="Wolfenstein Enemy Territory server" | |
PATH="/sbin:/bin:/usr/sbin:/usr/bin" |
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
class classproperty(property): | |
def __get__(self, cls, owner): | |
return self.fget.__get__(None, owner)() |
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
#!/usr/bin/env python3 | |
"""xev output data parser to get mouse polling rate. | |
Usage: | |
$ chmod a+x mouserate | |
$ xev | mouserate | |
""" | |
import sys | |
import re |
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
à a y | |
an au ce cm de du en et eu il je la le ma me ne ni on ou pu sa se si un | |
va vu | |
ait ans aux bas bel bon car cas ces cet des dit dix dur est etc été eux fer feu | |
fil fin fut gaz ici ils jeu les loi lui mal mer mes met mis moi mon mot nom non | |
nos ont par pas peu put que qui roi rue ses six soi sol son sud sur tel une vie | |
vif vin vit vos vue |
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
class Factory(object): | |
model = object | |
def __init__(self): | |
self._objs = {} | |
def create(self, name): | |
self._objs[name] = type(name, self.model.__bases__, dict(self.model.__dict__)) | |
return self._objs[name] |