Skip to content

Instantly share code, notes, and snippets.

@geroembser
geroembser / lecake.py
Last active December 4, 2023 07:42
Happy Birthday
from datetime import datetime
def create_birthday_cake():
# Define the reference date: October 24th, 2016 at 2pm
reference_date = datetime(2016, 10, 24, 14, 0, 0)
# Get the current system time
current_time = datetime.now()
# Calculate the difference
@geroembser
geroembser / scrollanimations.tsx
Created July 24, 2022 22:46
Framer Sites Scroll Animations
import type { ComponentType } from "react"
import type { MotionValue, Transition } from "framer-motion"
import {
useViewportScroll,
useVelocity,
useTransform,
useAnimation,
useMotionValue,
animate,
} from "framer-motion"
@geroembser
geroembser / aggregate.py
Last active June 11, 2021 05:15
Aggregated GitStats for Lern-Fair (former Corona School)
#!/usr/bin/env python3
# NOTE:
# * This was tested with python3.9
# * This uses `gitstats`: http://gitstats.sourceforge.net/
# * Also https://github.com/newren/git-filter-repo is required to work
import tempfile
import os
import subprocess
name: ml-environment
channels:
- conda-forge
dependencies:
- python
- numpy
- pip
- pip:
- nbgitpuller
- sphinx-gallery
@geroembser
geroembser / mailjet_all_clicks.js
Last active April 29, 2020 02:06
Download clicked-links data of campaigns from Mailjet's website
async function fetchClickList(pageN, token, apiPathName, referrer) {
const url = `https://app.mailjet.com${apiPathName}`
const options = {
"headers": {
"accept": "*/*",
"accept-language": "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7",
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded",
"pragma": "no-cache",
"sec-fetch-dest": "empty",