Skip to content

Instantly share code, notes, and snippets.

View jschpp's full-sized avatar

Johannes Schöpp jschpp

View GitHub Profile
Sub Super_Sub()
'
' Keyboard Shortcut: Ctrl+Shift+D
'
' If the characters are surrounded by "<" & ">" then they will be subscripted
' If the characters are surrounded by "{" & "}" then they will be superscripted
'
Dim NumSub
Dim NumSuper
Dim SubL
@jschpp
jschpp / .mailcap
Last active April 26, 2016 10:10 — forked from pcon/.mailcap
Configurations for mutt and lynx
text/html; links -dump -width 78 %s | sed "s/^ //"; copiousoutput; needsterminal; nametemplate=%s.html
@jschpp
jschpp / send_md_as_mail.sh
Created August 24, 2016 15:26
Takes a markdown file converts it to html and sends it per mutt. Script includes a mail check because I'm prone to typos in mail addresses
#!/bin/bash
filename=$1
mail_address=$2
mail_subject=$3
scriptname=`basename "$0"`
if [ "$#" -ne 3 ]; then
echo "Illegal number of parameters"
echo "Usage: $scriptname <filename> <mail_address> <subject_of_mail>"
exit 1
jschpp:~/exclude_from_backup/src/dosage (master) $ ./dosage CyanideAndHappiness Dilbert FonFlatter SandraAndWooGerman xkcd AhoiPolloi GaiaGerman LoadingArtist SMBC LookingForGroup Ruthe DieFruehreifen JohnnyWander PennyArcade SafelyEndangered Wumo Arcamax/ArcticCircle
CyanideAndHappiness> Retrieving 1 strip
CyanideAndHappiness> Saved Comics/CyanideAndHappiness/4431_sting.png (70.79KB).
Dilbert> Retrieving 1 strip
Dilbert> Saved Comics/Dilbert/2016-10-05.gif (127.35KB).
FonFlatter> Retrieving 1 strip
FonFlatter> Saved Comics/FonFlatter/fred_2016-10-05_s.png (25.81KB).
SandraAndWooGerman> Retrieving 1 strip
SandraAndWooGerman> Saved Comics/SandraAndWooGerman/2016-10-03-0826-die-goettliche-komoedie-seite-24.png (69.46KB).
xkcd> Retrieving 1 strip
@jschpp
jschpp / pdfpagecount.py
Last active January 13, 2017 08:04
Count sum of number of pages in a folder. Can be called with `-r` to check subdirectories also.
"""count pdf pages"""
from __future__ import print_function
import sys
from getopt import GetoptError, getopt
from PyPDF2 import PdfFileReader
try:
from os import scandir
except ImportError:
from scandir import scandir
@jschpp
jschpp / CBS.log
Created March 9, 2018 10:57
.net 3.5 installation fail error logs on Server 2012 R2
This file has been truncated, but you can view the full file.
2018-03-09 11:33:37, Info CBS Trusted Installer is shutting down because: SHUTDOWN_REASON_AUTOSTOP
2018-03-09 11:33:37, Info CBS TiWorker signaled for shutdown, going to exit.
2018-03-09 11:33:37, Info CBS Ending the TiWorker main loop.
2018-03-09 11:33:37, Info CBS Ending the TrustedInstaller main loop.
2018-03-09 11:33:37, Info CBS Starting TiWorker finalization.
2018-03-09 11:33:37, Info CBS Starting TrustedInstaller finalization.
2018-03-09 11:33:37, Info CBS Ending TrustedInstaller finalization.
2018-03-09 11:33:37, Info CBS Ending TiWorker finalization.
2018-03-09 11:33:56, Info CBS TI: --- Initializing Trusted Installer ---
2018-03-09 11:33:56, Info CBS TI: Last boot time: 2018-03-07 14:02:10.495
@jschpp
jschpp / Export-PowerShellDataFile.psm1
Last active December 29, 2022 18:19
Exports a powershell object to a psd1 format. Can be re-imported via Import-PowershellDataFile
function Get-IdentedString {
<#
.SYNOPSIS
Returns $obj as indented string
.DESCRIPTION
Turns $obj to string and adds $indent * 4 spaces in front of it
.PARAMETER obj
Object to be converted to String
@jschpp
jschpp / diff.ps1
Last active May 17, 2018 13:17
Quick and dirty diff in powershell
param (
[switch]$CompareObjects,
$left, # if I specify [string[]]$left the Property ReadCount which is created by gc is lost -.-'
$right,
[switch]$DisplayWhitespace
)
if (!$CompareObjects) {
$left = Get-Content $left
$right = Get-Content $right
}
function ParseLine([string]$Line) {
$returnObject = @{
Date = $null
Time = $null
Status = $null
}
$returnObject.Date = Get-Date $line.Split(',')[0] -Format "dd/MM/yyyy"
$returnObject.Time = Get-Date $line.Split(',')[0] -Format "hh:mm:ss"
$returnObject.Status = $line.Split(',')[1].TrimEnd('.')
@jschpp
jschpp / error.html
Last active April 22, 2019 18:37
Error Stack from grav
<!DOCTYPE html>
<!-- saved from url=(0026)http://localhost/guestbook -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex,nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Crikey! There was an error...</title>
<style>body {
font: 12px "Helvetica Neue", helvetica, arial, sans-serif;