Skip to content

Instantly share code, notes, and snippets.

View D-Vaillant's full-sized avatar

David Vaillant D-Vaillant

View GitHub Profile
@D-Vaillant
D-Vaillant / .tmux.conf
Created January 23, 2024 21:46
Minimal TMUX.CONF file.
# set Ctrl-a as the default prefix key combination
set-option -g prefix C-a
#set-option -g prefix 133
bind-key C-a last-window
unbind C-b
bind a send-prefix
bind r source-file ~/.tmux.conf \; display-message "Config reloaded."
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
@D-Vaillant
D-Vaillant / .vimrc
Created January 23, 2024 19:36
Minimal VIMRC file.
" My minimal configuration. Used on everything.
"
let mapleader='\'
map <space> \
" Buffer navigation
" :bfirst and :blast for first and last
" :sb_ for 'in new window'
"nnoremap <Leader>h :bnext<CR>
"nnoremap <Leader>l :bprev<CR>
@D-Vaillant
D-Vaillant / bandwidth
Created February 1, 2019 14:55
i3blocks
#!/bin/bash
# Copyright (C) 2012 Stefan Breunig <stefan+measure-net-speed@mathphys.fsk.uni-heidelberg.de>
# Copyright (C) 2014 kaueraal
# Copyright (C) 2015 Thiago Perrotta <perrotta dot thiago at poli dot ufrj dot br>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@D-Vaillant
D-Vaillant / .vimrc
Created February 1, 2019 14:52
Some dotfiles.
set nocompatible
let HOSTNAME=substitute(system('hostname'),"\n","","")
" Vundle
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
let path='~/.vim/bundle'
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-surround'
@D-Vaillant
D-Vaillant / nightshift_magic.md
Last active October 19, 2017 03:47
An alternative to After Sundown's existing Magic chapter.

Magic

In addition to being monsters with shark teeth or blade hands or whatever else, in After Sundown most monstrous things have access to at least a little bit of magic. It's known by many names in many languages across the four worlds, and it's a fact of the universe that you have to be prepared for if you're hunting monsters or if you are the monsters.

The thing to keep in mind with magic in After Sundown is that it's never good magic. Magic is energy flowing from one of the three hells, and it's always evil. It might be used for a good cause, but in time the taint of evil will eventually twist even the best of intents until it begins to cause misery for the people involved.

Magical Terminology

"Now first let's get one thing straight about what's going on here."

An individual magical ability is known as a Power. Most powers require that you cast them. Casting a power involves you spending the action, possibly spending some power points, and possibly making a roll. Powers that involve

@D-Vaillant
D-Vaillant / keeg_ovens.py
Last active October 7, 2017 03:55
A humble begininng.
""" oven: has capacity N, takes time T to cook something
conveyer belt: connects points, takes T seconds
queue: it's a queue.
"""
from sys import setrecursionlimit
from random import randint
""" Platonic entities. """
class Void():
def __iadd__(self, num):
@D-Vaillant
D-Vaillant / scrape_table.py
Created August 30, 2017 09:57
Simple scraper.
from lxml import html
import requests
import csv
page = requests.get('http://www.lordbyng.net/inspiration/tables.php')
tree = html.fromstring(page.content)
tables = tree.xpath('//table[@class="pure-table"]')
@D-Vaillant
D-Vaillant / rice_2.5py
Created October 11, 2016 00:46
A computational solution to a discrete probability problem.
""" rice_2.5.py:
Because I have a computer to think for me.
"""
from collections import Counter
def left_pad(x: str) -> tuple:
l = 4-len(x)
return (0,) * l + tuple(map(int, x))
import random
def rand5():
return random.randrange(0, 5)
def is_disqualified(a, b):
return 3 <= a <= 4 and b <= 1
@D-Vaillant
D-Vaillant / gist:d2e5e496e142fa231750
Last active March 14, 2016 21:50
A possibly improved bit of Ruby about hashes.
if save_hash[save_loc].empty?
save_hash[save_loc] = {order["Order Number"] => hash_to_row(order, m.ordering)}
else
save_hash[save_loc][order["Order Number"]] = hash_to_row(order, m.ordering)
end