Skip to content

Instantly share code, notes, and snippets.

@jbarnoud
jbarnoud / Automatic Test Of Martini: Design.md
Last active November 25, 2016 08:04
Automatic test of Martini

Automatic Test Of Martini (title in progress)

The automatic test of Martini comprises four components:

  • a collection of tests with metadata;
  • a collection of input files shared among the tests;
  • a python and bash library of functions to ease the writing of tests;
  • a main program that allows to list, select, and run the tests on various target computer, but also that compiles a global report from the individual report of each test.

A user must be able to run all or part of the test suite on a local or a remote computer. It must be able to overwrite some parameters, and to easily add new tests.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2016 Yannick Loiseau <me@yloiseau.net>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
"""
on-modify hook for taskwarrior.
This hook connects taskwarrior and watson.
@jbarnoud
jbarnoud / kmeans.ipynb
Last active September 28, 2015 09:48
Hereby is a notebook that explores K-means in the context of PBxplore.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@olberger
olberger / shibb-cas-get.sh
Created December 4, 2014 09:59
Connection to a web app protected via Shibboleth with curl
#!/bin/sh
#set -x
# Usage: shibb-cas-get.sh {username} {password} # If you have any errors try removing the redirects to get more information
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method)
DEST=https://myapp.example.com/
SP=https://myapp.example.com/index.php
IDP="https://myidp.example.com/idp/shibboleth&btn_sso=SSOok"
@dghodgson
dghodgson / pulseaudio-auto-loopback.py
Last active December 15, 2019 05:29
A python script for automatically adding a loopback module to Pulse Audio for a bluetooth audio source when it's connected, and automatically removing the loopback module when the bluetooth device disconnects.Original code found here: https://gist.github.com/joergschiller/1673341/#comment-802735
#!/usr/bin/python
# based on monitor-bluetooth
# Changes by Domen Puncer <domen@cba.si>
import gobject
import dbus
import dbus.mainloop.glib
import os
@ritsz
ritsz / LKTrack.py
Created August 9, 2012 09:26 — forked from jayrambhia/LKTrack.py
Lucas Kanade Tracker (OpenCV)
import cv2
import numpy as np
import itertools
lk_params = dict( winSize = (10, 10),
maxLevel = 5,
criteria = (cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 10, 0.03))
feature_params = dict( maxCorners = 3000,
qualityLevel = 0.5,
@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@huyng
huyng / matplotlibrc
Created February 8, 2011 15:50
my default matplotlib settings
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).