Skip to content

Instantly share code, notes, and snippets.

View tobaco's full-sized avatar

Torsten Baldes tobaco

View GitHub Profile
@tobaco
tobaco / dabblet.css
Created November 16, 2017 07:20 — forked from LeaVerou/dabblet.css
Two column <dl> with two lines of CSS! Thank you Grid Layout!
/**
* Two column <dl> with two lines of CSS! Thank you Grid Layout!
* Limitation: Breaks if we have multiple consecutive <dt>s or <dd>s
*/
dl {
display: grid;
grid-template: auto / 10em 1fr;
}
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
"Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans",
"Droid Sans", "Helvetica Neue", sans-serif;
}
@tobaco
tobaco / wach-und-wichtig.js
Created March 3, 2021 08:38 — forked from marco79cgn/wach-und-wichtig.js
iOS widget, das die neueste Folge des radioeins Podcasts "Wach & Wichtig" anzeigt und abspielt (für die Scriptable.app)
// Wach und Wichtig Podcast Widget
//
// Copyright (C) 2020 by marco79 <[email protected]>
//
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
// IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
@tobaco
tobaco / purge_cf.php
Created January 24, 2022 11:53 — forked from Greg-Boggs/purge_cf.php
PHP code to Purge Cloudflare Cache
<?php
// Replace EMAIL/API_KEY/ZONE_ID with your details.
// Zone ID is on the dashboard for the domain in the bottom right.
// Api keys are generated from the account settings. You must give cache purge permissions
// Place this script on your webserver and point a Github Webhook at it, and you'll clear
// the Cloudflare cache every time you do a push to GH.
try {
$head = [];
$head[] = 'Content-Type: application/json';
@tobaco
tobaco / darkmode.css
Created February 27, 2023 09:29
Simple darkmode
<style>
@media (prefers-color-scheme: dark) {
body {
filter: invert(100%) hue-rotate(.5turn);
background-color: rgb(199, 206, 204) !important;
}
img:not(.logo__img),
.emoji,
iframe{
@tobaco
tobaco / whisper.php
Created December 6, 2024 14:13 — forked from martinbowling/whisper.php
transcribe mp3 to text via Whisper
<?php
$req_url = "https://api.openai.com/v1/engines/audio-transcribe-801/transcriptions";
$openai_key = getenv("OPENAI_API_KEY");
$file_path = "test.mp3";
$file = file_get_contents($file_path);
$form_fields = array(
'file' => array($file_path, $file, 'audio/mpeg')
);