Skip to content

Instantly share code, notes, and snippets.

View andi1984's full-sized avatar
🏠
Working from home

Andreas Sander andi1984

🏠
Working from home
View GitHub Profile
@andi1984
andi1984 / nav.json
Last active February 22, 2023 21:36
test nav.json
{
"private": {
"links": [
{ "label": "Twitter", "url": "http://www.twitter.com" },
{ "label": "LinkedIn", "url": "https://www.linkedin.com/"},
{ "label": "Matrix", "url": "https://app.element.io/"},
{ "label": "Geizhals", "url": "https://geizhals.de/"},
{ "label": "MyDealz", "url": "https://www.mydealz.de/"},
{ "label": "Wetter", "url": "https://kachelmannwetter.com/de/wetter/2862923-niedersalbach"},
{ "label": "Raindrop", "url": "https://app.raindrop.io/"}
@andi1984
andi1984 / demo.js
Last active November 27, 2020 10:34
/**
* @typedef {import("./typings").Car} Car
*/
/**
* @type {Car}
*/
const porsche993 = {};
@andi1984
andi1984 / docker
Last active September 30, 2020 17:48
#!/bin/bash# Delete all containersdocker
rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)# Prune unused volumesdocker volume prune
# https://unix.stackexchange.com/a/38380
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4
@andi1984
andi1984 / lint.css
Last active July 7, 2020 12:48
Lint HTML CSS #lintHTMLwithCSS
/* forbidden nesting */
:not(figure) > figcaption,
:not(fieldset) > legend,
:not(dl) > :is(dt, dd),
:not(tr) > :is(td, th),
:not(select) > :is(option, optgroup),
:not(table) > :is(thead, tfoot, tbody, tr, colgroup, caption) {
outline: 2px dotted red;
}
@andi1984
andi1984 / lambda.py
Created May 7, 2020 08:43
Lambda - Bitbucket, change PR description
import json
from botocore.vendored import requests
import os
def lambda_handler(event, context):
payload = json.loads(event['body'], encoding='utf8')
title = payload["pullrequest"]["title"]
description = payload['pullrequest']['description']
with open('checklist.txt') as f:
extra_text = f.read()
@andi1984
andi1984 / 1-easy.js
Created January 6, 2020 19:04 — forked from nybblr/1-easy.js
3 examples of using Async Generators and Async Iteration in JavaScript!
// Create a Promise that resolves after ms time
var timer = function(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
};
// Repeatedly generate a number starting
// from 0 after a random amount of time
var source = async function*() {
@andi1984
andi1984 / netlify.toml
Created June 13, 2019 17:52
Example netlify config
# Settings in the [build] context are global and are applied to all contexts
# unless otherwise overridden by more specific contexts.
[build]
# Directory to change to before starting a build.
# This is where we will look for package.json/.nvmrc/etc.
base = "project/"
# Directory (relative to root of your repo) that contains the deploy-ready
# HTML files and assets generated by the build. If a base directory has
# been specified, include it in the publish directory path.
@andi1984
andi1984 / save-file-local.js
Created November 15, 2018 15:09 — forked from liabru/save-file-local.js
Save a text file locally with a filename, by triggering a download in JavaScript
/*
* Save a text file locally with a filename by triggering a download
*/
var text = "hello world",
blob = new Blob([text], { type: 'text/plain' }),
anchor = document.createElement('a');
anchor.download = "hello.txt";
anchor.href = (window.webkitURL || window.URL).createObjectURL(blob);
@andi1984
andi1984 / shell.sh
Created September 29, 2018 21:21
Mastodon - Fix folder permissions
sudo docker-compose run --rm -u root web chown -R mastodon:mastodon public/assets public/packs public/system