Skip to content

Instantly share code, notes, and snippets.

View nicoe's full-sized avatar

Nicolas Évrard nicoe

View GitHub Profile
def scratchpad(window):
window.floating = True
screen = window.group.screen
window.tweak_float(
x=int(screen.width / 4),
y=int(screen.height / 4),
w=int(screen.width / 2),
h=int(screen.height / 2),
)
[global]
geometry = "400x5-30+20"
transparency = 0
padding = 8
horizontal_padding = 8
frame_width = 3
frame_color = "#aaaaaa"
separator_color = frame
idle_threshold = 120
font = FiraCode 10
@nicoe
nicoe / main.rs
Created May 1, 2020 12:54
AoC2019 - 10.1
use std::cmp;
use std::collections::HashSet;
use std::env;
use std::fs::File;
use std::io::{BufRead, BufReader};
struct LengthScanner {
length: isize,
current: (isize, isize),
quadrant: usize,
@nicoe
nicoe / battery-block
Created July 9, 2019 11:10
A battery block with notification for i3
#!/usr/bin/env python3
#
# Copyright (C) 2016 James Murphy
# Licensed under the GPL version 2 only
#
# A battery indicator blocklet script for i3blocks
import gi
import re
import pathlib
#!/usr/bin/env python
import os
from gi.repository import Gtk
from gi.repository import GLib
POMODORO_TIME = 25
BREAK_TIME = 5
LONG_BREAK_TIME = 15
LONG_BREAK_OCCURENCE = 4
@nicoe
nicoe / run-tryton-test
Created March 29, 2019 10:46
Script to run tryton tests
#!/usr/bin/zsh
if [ -z $VIRTUAL_ENV ]; then
echo 'Set a virtualenv first!'
exit 1
fi
source $VIRTUAL_ENV/bin/activate
TRYTOND_CONFIG=$HOME/.trytond_test.conf PYTHONPATH=$PWD/proteus:$PWD/trytond ./trytond/trytond/tests/run-tests.py $*;
RETURN_CODE=$?