Skip to content

Instantly share code, notes, and snippets.

View rasschaert's full-sized avatar

Kenny Rasschaert rasschaert

View GitHub Profile
@peterhurford
peterhurford / pytest-fixture-modularization.md
Created July 28, 2016 15:48
How to modularize your py.test fixtures

Using py.test is great and the support for test fixtures is pretty awesome. However, in order to share your fixtures across your entire module, py.test suggests you define all your fixtures within one single conftest.py file. This is impractical if you have a large quantity of fixtures -- for better organization and readibility, you would much rather define your fixtures across multiple, well-named files. But how do you do that? ...No one on the internet seemed to know.

Turns out, however, you can define fixtures in individual files like this:

tests/fixtures/add.py

import pytest

@pytest.fixture
@jeremyj
jeremyj / watch haproxy sticky tables
Created October 16, 2014 10:13
watch haproxy sticky tables
watch -n 1 'echo "show table http" | socat unix:/var/run/haproxy.sock -'
watch -n 1 'echo "show table public" | socat unix:/var/run/haproxy.sock -'
@Jasmien
Jasmien / pot_with_leds.ino
Created February 9, 2014 00:50
If you turn the potentiometer up, more LEDs light up and vice versa.
// assign names and values
int green1 = 2;
int green2 = 3;
int green3 = 4;
int yellow1 = 5;
int yellow2 = 6;
int yellow3 = 7;
int red1 = 8;
int red2 = 9;
int red3 = 10;
@chronossc
chronossc / gist:7439737
Created November 12, 2013 22:13
meld dark theme, add it to ~/.gtkrc-2.0
style "meld-color-scheme-user"
{
# inserted line(s), also edge color block for added file in dir diff
color["insert-bg"] = "#006000"
color["insert-outline"] = shade(1.5, @insert-bg)
# In dir diff, an added file's name
color["insert-text"] = "white"
# Color block on edge for missing file in dir diff
color["delete-bg"] = "#800000"
@obstschale
obstschale / octave.md
Last active March 29, 2024 22:51
An Octave introduction cheat sheet.