Skip to content

Instantly share code, notes, and snippets.

Avatar

Nicolas Évrard nicoe

View GitHub Profile
@nicoe
nicoe / main.rs
Created May 1, 2020
AoC2019 - 10.1
View main.rs
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 Jul 9, 2019
A battery block with notification for i3
View battery-block
#!/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
View pomodoro
#!/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 Mar 29, 2019
Script to run tryton tests
View run-tryton-test
#!/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=$?
View config.py
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),
)