Skip to content

Instantly share code, notes, and snippets.

View prs513rosewood's full-sized avatar

Lucas Frérot prs513rosewood

View GitHub Profile
#!/usr/bin/env bash
# Updates a Gandi DNS record with the current IP of the machine
# Gandi API documentation: https://api.gandi.net/docs/livedns/
set -euo pipefail
if [ $# -ne 3 ]; then
echo "usage: gandi_update_ip apikey domain subdomain"
exit 1
fi
#!/usr/bin/env sh
usage(){
echo "usage: zerotier-hosts network_id api_token"
}
if [ $# -ne 2 ]; then
usage
exit 1
fi
@prs513rosewood
prs513rosewood / make_arxiv.sh
Last active June 9, 2020 19:48
Makes a tarball for ArXiv submission.
#!/usr/bin/bash
tar -cvzf ./$(basename $1).tar.gz \
--exclude-vcs \
--exclude-vcs-ignores \
--exclude="auto" \
$1/src $1/ms.tex $1/ms.bbl $1/Makefile
@prs513rosewood
prs513rosewood / weird_latex_error.txt
Created October 23, 2018 15:57
Copy-paste the \@tempa... to duck duck go and see what happens
./theory_continuous.tex:233: Undefined control sequence.
\@tempa ->\catcode `\<
12\relax \catcode `\>12\relax \catcode `\=12\relax
l.233 \subsubsection{Basis of $\ker(\fnavier)$}
import matplotlib.font_manager
from os.path import basename
font_list = matplotlib.font_manager.findSystemFonts(fontpaths=None, fontext='ttf')
font_list = sorted((basename(font) for font in font_list))
for font in font_list:
print(font)
@prs513rosewood
prs513rosewood / talk.cls
Last active May 11, 2020 15:42
My regular talk class for beamer presentations
%% talk.cls
%%
%% Author: @prs513rosewood
%% Install to ~/.textlive<version>/textmf-config/tex/latex
%% Class declaration
\ProvidesClass{talk}[2019.11.7 version 0.02 Seminar Talk]
\NeedsTeXFormat{LaTeX2e}

Keybase proof

I hereby claim:

  • I am prs513rosewood on github.
  • I am hexley (https://keybase.io/hexley) on keybase.
  • I have a public key ASC5i72PEME7pLq-TO20Pwf9ybsTLUa3Tn0c7bjTZJP6xwo

To claim this, I am signing this object:

@prs513rosewood
prs513rosewood / xor.m
Created March 25, 2012 19:35 — forked from anonymous/xor.m
XOR Encryption in ObjC
#import <stdio.h>
#import <Foundation/Foundation.h>
#define SIZE_BLOCK 512
void xor (uint8_t * a, uint8_t * b, unsigned int size, NSString * key)
{
unsigned int i;
for (i = 0 ; i < size ; i++) {
@prs513rosewood
prs513rosewood / mdown.vim
Created September 5, 2010 14:37
Vim syntax file for the mdown markup language.
"
" Syntax file for the mdown markup language.
"
syn match mdownComment /^ *%.*$/ contains=mdownTodo
syn keyword mdownTodo TODO XXX FIXME Note contained
syn region mdownEmphasis1 start="[^\\a-zA-Z0-9]\?/" skip="\\\/" end="/"
syn region mdownEmphasis2 start="[^\\a-zA-Z0-9]\?\*" skip="\\\*" end="*"
syn region mdownCode start="[^\\a-zA-Z0-9]\?`" skip="\\`" end="`"
syn match mdownAnchor /\[[^\]]*\]/
@prs513rosewood
prs513rosewood / tutomake.py
Created August 26, 2010 15:42
Converting tutos from text to xml (and the other way arround) for SdZ
#!/usr/bin/python
# -*- coding:utf-8 -*-
# Copyright (C) 2010 Lucas Frérot
#
# 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.
#