Skip to content

Instantly share code, notes, and snippets.

@OrangeTux
OrangeTux / gist:d24b0ca0cd33fe6a52c2
Created June 4, 2015 09:56
Decorator which executes callback if wrapped Fabric task fails.
def on_fail(func):
""" Return decorator which executes callback if wrapped tasks failes.
Usage:
def log_failure():
print('Some failure.')
@task
@on_fail(log_failure):
def git_fetch():
[tool.poetry]
name = "issue"
version = "0.1.0"
description = ""
authors = ["Auke Oosterhoff <auke@orangetux.nl>"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
@OrangeTux
OrangeTux / config
Last active June 19, 2021 13:18
Config for Irssi to connect to various XMPP chat servers. Replace the passwords, usernames an ids by your own. Remember, the irssi-xmpp (http://cybione.org/~irssi-xmpp/) plugin is requried.
# irssi-xmpp plugin required
# http://cybione.org/~irssi-xmpp/
servers = (
{
address = "chat.facebook.com";
chatnet = "facebook";
password = "<password>";
autoconnect = "true";
},
{
import asyncio
from datetime import datetime
try:
import websockets
except ModuleNotFoundError:
print("This example relies on the 'websockets' package.")
print("Please install it by running: ")
print()
print(" $ pip install websockets")
@OrangeTux
OrangeTux / log.yml
Created November 13, 2013 14:52
Sample config for Python's logging module. Load it with ` logging.config.dictConfig(yaml.load(open('path/to/config','r')))`.
version: 1
formatters:
simple:
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
handlers:
console:
class: logging.StreamHandler
formatter: simple
level: DEBUG
stream: ext://sys.stdout
external/package
├── mender
│   ├── Config.in
│   ├── mender.conf
│   ├── mender-device-identity
│   ├── mender.hash
│   ├── mender-inventory-hostinfo
│   ├── mender-inventory-network
│   ├── mender.mk
│   ├── mender.service

Keybase proof

I hereby claim:

  • I am orangetux on github.
  • I am orangetux (https://keybase.io/orangetux) on keybase.
  • I have a public key ASCwozSFEvXlpeU31Jx-4DV36dB9pzpM_moBADsJ8CIaiAo

To claim this, I am signing this object:

func (s *Server) readMessage(r *bufio.Reader) ([]byte, error) {
something_went_wrong error
buf := make([]byte, 6+length)
b, err := r.Peek(6)
something_went_wrong = err
if something_went_wrong == nil {
length := binary.BigEndian.Uint16(b[4:6])
_, err = r.Read(buf)
import pychromecast
casts = pychromecast.get_chromecasts_as_dict().keys()
# cast = pychromecast.get_chromecast(friendly_name="Stroopwafel Bij Je Bier")
mc = cast[0].media_controller
mc.play_media('http://l2cm9c1b98fe3f00581dd388000000.cf9b35b0fb7138c2.smoote2d.npostreaming.nl/d/live/npo/thematv/journaal24/journaal24.isml/journaal24.m3u8', 'application/x-mpegurl')
call plug#begin('~/.vim/plugged')
" Vim plugin for the_silver_searcher, 'ag', a replacement for the Perl module / CLI script 'ack'.
Plug 'rking/ag.vim'
" Full path fuzzy file, buffer, mru, tag, ... finder for Vim.
Plug 'kien/ctrlp.vim'
" Vim plugin, provides insert mode auto-completion for quotes, parens, brackets, etc.
Plug 'Raimondi/delimitMate'