Skip to content

Instantly share code, notes, and snippets.

View AlbericC's full-sized avatar

Atrament AlbericC

  • Grenoble, France
View GitHub Profile
@AlbericC
AlbericC / awesomedeps.bash
Last active January 4, 2017 08:42
install awesome window manager build dependencies on debian testing as per 2017-01-01
sudo aptitude install libglib2.0-dev libgdk-pixbuf2.0-dev libcairo2-dev libx11-dev libxcb-cursor-dev libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-util0-dev libxcb-keysyms1-dev libxcb-icccm4-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev libcairo2-dev libstartup-notification0-dev x11proto-core-dev libxdg-basedir-dev libxcb-xrm-dev
#! /bin/bash
# launch a desktop output stuff !
# requires : an internet connection,
# curl
# remind (and a .reminders file)
# fortune (and custom fortune at ~/.fortunes/cusfor)
# ~/planning and ~/todo
# t command-line twitter client
# Font 'Noto-Mono' free as in whatever from google
"""
"""
import operator as op
def eval_safer(s):
"""basic parsinig an evaluation of expressions."""
ops = {'*': op.mul,
'+': op.add,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def verbal(some_class):
"""intended as a class decorator allowing to list all attributes and where
they come from"""
def tell(inst):
print(
"{:>16}: {}\n"
.format("instance",
", ".join(a
for a in vars(inst)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AlbericC
AlbericC / deskscript.sh
Last active October 3, 2015 14:38
console outputs on the background !
#! /usr/bin/env bash
# launch a desktop output stuff !
# conky stuff might use some tweaking with some window managers
# basically use conky to detect what is the real desktop window on your desktop
WINDOW=0x$(conky -i 1 2>&1 | head -n 1 | awk '{print $4}' | sed -e 's/(//' -e 's/)//')
ITVAL=5 # update interval (seconds)
# prepare some named pipes. (in tmp)
@AlbericC
AlbericC / get_fonts
Created July 9, 2015 08:38
quick install (user-wide) emoji support debian based linux (mint)
# /usr/bin/env sh
mkdir ~/.fonts && cd ~/.fonts ;
wget http://download.damieng.com/fonts/redistributed/DroidFamily.zip &&
unzip DroidFamily.zip && rm DroidFamily.zip ;
wget http://users.teilar.gr/~g1951d/Symbola.zip &&
unzip Symbola.zip && rm Symbola.zip
@AlbericC
AlbericC / decorators.py
Last active August 29, 2015 14:17
decorators decorators decorators !
__author__ = "atrament"
__all__ = "talkative", "timed", "Memoize", "mro_list"
from time import time
from functools import wraps
def talkative(message=""):
"""decorator for custom trace of a function"""
@AlbericC
AlbericC / gist:8262cb6b7e9516d6c03a
Last active August 29, 2015 14:16
Pass extra information to a kv-defined widget
from kivy.app import App
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.uix.boxlayout import BoxLayout
kv = """
<Test>:
orientation: 'vertical'
Button: