Skip to content

Instantly share code, notes, and snippets.

View Paebbels's full-sized avatar

Patrick Lehmann Paebbels

View GitHub Profile
@Paebbels
Paebbels / inspect_objects.py
Created January 5, 2021 01:00 — forked from acsr/inspect_objects.py
patch sphinx.ext.intersphinx output tweaking the main function to using almost csv compatible tab separators instead of columns adjusted by spaces
#!./bin/python
# -*- coding: utf-8 -*-
"""
inspect_objects
based on and requiring sphinx.ext.intersphinx
~~~~~~~~~~~~~~~~~~~~~~
List links to objects documented in as build Sphinx documentation.
@Paebbels
Paebbels / gist:3a111f070f3151383d5021e0eec46f52
Created August 7, 2020 06:29 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:i:1}"
case $c in
[a-zA-Z0-9.~_-]) printf "$c" ;;
@Paebbels
Paebbels / ssh-tar
Created November 21, 2018 21:07 — forked from purplefish32/ssh-tar
Compress and copy via SSH using TAR
#Compress and copy via SSH using SCP and TAR
tar -czf - /some/file | ssh joebloggs@otherserver.com tar -xzf - -C /destination
#Switch -c for tar creates an archive and -f which tells tar to send the new archive to stdout.
#The second tar command uses the -C switch which changes directory on the target host. It takes the input from stdin. The -x switch extracts the archive.
#The second way of doing the transfer over a network is with the -z option, which compresses the stream, decreasing time it will take to transfer over the network.
#Some people may ask why tar is used, this is great for large file trees, as it is just streaming the data from one host to another and not having to do intense operations with file trees.
#If using the -v (verbose) switch, be sure only to include it on the second tar command, otherwise you will see double output.
#Using tar and piping can also be a great way to transfer files locally to be sure that file permissions are kept correctly
@Paebbels
Paebbels / README.md
Created September 21, 2017 06:19 — forked from JamesMessinger/README.md
VSCode GitHub Markdown Theme

GitHub Markdown Theme for Visual Studio Code

This CSS stylesheet allows you to preview markdown files in VSCode using GitHub's mardown theme. This CSS was taken directly from the official GitHub Markdown repo. I replaced their top-level .markdown-body class with the body tag so it would work in VSCode, and added styling for the html tag to match GitHub's fixed-width container.

Instructions

  1. Copy the CSS file to your computer
    Copy the github-markdown.css file below to your computer. You can put it anywhere you want, but I chose to put it in the same folder as my VSCode settings file.

  2. Edit your VSCode settings
    If you want to use this theme for all of your projects, then edit your User Settings file. If you just want to use this them