Skip to content

Instantly share code, notes, and snippets.

View sebastianrothbucher's full-sized avatar

Sebastian Rothbucher sebastianrothbucher

View GitHub Profile
@sebastianrothbucher
sebastianrothbucher / cell.py
Last active August 19, 2025 11:23
Jupyter HTML and several displays - just store for once
import pandas as pd
from IPython.core.display import HTML
# display several
display("one")
display(pd.DataFrame({"a": [1, 2]}))
print("two-a")
display(HTML('<em style="color: hotpink">two-b</em><a href="https://bla">Link gets rendered in PDF</a>'))
display("two-c")
@sebastianrothbucher
sebastianrothbucher / combine.tex
Last active August 19, 2025 11:24
All PDF manipulations - nice and open src (pypdf would be an alternative - see below)
\documentclass{article}
\usepackage{pdfpages}
\usepackage{background}
\backgroundsetup{scale = 1, angle = 0, opacity = 1,
contents = {\includegraphics[width = \paperwidth,
height = \paperheight, keepaspectratio]
{testbriefkopf.pdf}}}
% for different, we can have two steps: first background, then merge
\begin{document}
\includepdf[pages=-]{dinbrief2.pdf}
library(magick)
library(reshape2)
library(dplyr)
library(tidygraph)
library(particles)
library(animation)
plot_fun <- function(sim) {
df <- as_tibble(sim)
plot(df$x, df$y, col = df$color, pch = '.', axes = FALSE, xlim = c(-100, 317), ylim = c(-268, 100), xlab = NA, ylab = NA)
@jonathanstark
jonathanstark / verify-google-recaptcha-with-php
Last active July 16, 2024 17:06
Verify Google reCAPTCHA with PHP
#
# Verify captcha
$post_data = http_build_query(
array(
'secret' => CAPTCHA_SECRET,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
)
);
$opts = array('http' =>
@elidickinson
elidickinson / max_width_email.html
Created May 6, 2013 15:10
Email Template trick: max-width with outlook
<!--[if mso]>
<center>
<table><tr><td width="580">
<![endif]-->
<div style="max-width:580px; margin:0 auto;">
<p>This text will be centered and constrained to 580 pixels even on Outlook which does not support max-width CSS</p>
</div>
<!--[if mso]>
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE