Skip to content

Instantly share code, notes, and snippets.

@timm0e
timm0e / ERD.gv
Last active November 15, 2018 14:58
Graphviz ER (Entity-Relationship) Example + VS Code snippets (incomplete)
graph ERD{
//Entities
node [shape=box;fillcolor=orange;style=filled]
Bundesland
Wahlkreis
Wahlbezirk
Direktkandidat
Partei
Wahlergebnis [peripheries=2]
Stimme
@timm0e
timm0e / .jsbeautifyrc
Created April 28, 2018 22:07
Enable ejs beautification in beautfy for VS code
{
"html": {
"void_elements": [
"area",
"base",
"br",
"col",
"embed",
"hr",
"img",
@timm0e
timm0e / gdrive_curl.sh
Last active April 4, 2018 11:54
Download large files (skipping the virus check) from Google Drive via curl
#!/bin/bash
# Usage: ./gdrive_curl.sh <your link to file over 40 MB> | xargs curl -youradditionalcurlarguments
(echo "Generating curl arguments..." >&2)
regex='jfk-button-action" href="([^"]*)">'
if [[ $(curl -s -c /tmp/cookies.txt $1) =~ $regex ]]; then echo -L -b /tmp/cookies.txt \'https://drive.google.com${BASH_REMATCH[1]//amp;/}\';fi
(echo "Done!" >&2)
@timm0e
timm0e / dircmp.m4
Created April 1, 2018 12:27
Dircmp - compare folders with cmp and output the files that are different - great for creating "delta" archives
#!/bin/bash
#
# This is a positional arguments-only example of Argbash potential
#
# ARG_HELP([The general script's help msg])
# ARG_POSITIONAL_SINGLE([changed], [The directory with changed contents])
# ARG_POSITIONAL_SINGLE([unchanged], [The directory with unchanged contents])
# ARGBASH_GO
# [ <-- needed because of Argbash
# you need jq installed
set GITHUB_USER <YOUR USER NAME>
complete -c git -n "string match -r '^git clone.*' (commandline) > /dev/null ; echo $status" -a '(curl -Ls https://api.github.com/users/$GITHUB_USER/repos|jq ".[]|.clone_url" -c|string replace -a "\"" "")'