#define VERSION_STRING "@VERSION_STRING@"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Inspired by: https://gist.github.com/oprypin/9668969 | |
import argparse | |
import pygments | |
import pygments.formatters | |
import pygments.lexers | |
import re | |
import sys |
# Change this to the name of your account
ACCOUNT_NAME=Personal
###
CONTAINER_NAME="$(echo "onedrive-${ACCOUNT_NAME}" | tr '[:upper:]' '[:lower:]')"
VOLUME_NAME="${CONTAINER_NAME}-conf"
ONEDRIVE_DATA_DIR="${HOME}/OneDrive${ACCOUNT_NAME}"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function run_in_docker() | |
{ | |
docker run --rm -i -u "$(id -u):$(id -g)" $DOCKER_IMAGE bash -s | |
} | |
# Usage: | |
run_in_docker <<EOF || echo "Failed!" | |
set -e | |
echo "Do something in container..." | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cassert> | |
#include <cstdint> | |
#include <iostream> | |
#include <memory> | |
#include <sstream> | |
#include <utility> | |
#include <vector> | |
// Visited hierarchy | |
struct AstBase { |
Oneliner to diff a set of files pairwise in different tabs with Vim:
gvim -R -c 'for i in range(1, argc() - 1) | if i % 2 == 1 | rightbelow vertical diffsplit | next | diffthis | else | tabedit | next | endif | endfor' a b c d
- Open PDF in InkScape. Use Poppler/Cairo import.
- Ungroup all using
CTRL + A
andCTRL + SHIFT + G
. - Select what you want to keep and delete the rest using
!
andDELETE
. - Autoresize the canvas using
CTRL + SHIFT + R
. - Save as
.EMF
file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
send() | |
{ | |
local length=${#1} | |
printf "Content-Length: $length\r\n" >pipe | |
printf '\r\n' >pipe | |
printf ${1//\\/\\\\} >pipe | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
mkfifo pipe # Created named pipe | |
program <pipe & # Start program | |
exec 3>pipe # Open file descriptor 3, writing to the named pipe | |
# Write to pipe using printf, echo, cat, ... | |
exec 3>&- # Close the named pipe (file descriptor 3) |
Without timestamps:
#!/usr/bin/env bash
exec > >(tee -ai ~/app-stdout.log) 2> >(tee -ai ~/app-stderr.log >&2)
app $*
With timestamps (requires ts
from moreutils
):
NewerOlder