Skip to content

Instantly share code, notes, and snippets.

@petermolnar
petermolnar / themeswitcher.css
Last active December 11, 2023 13:06
automatic (prefers-color-scheme) and manual CSS theme switcher with vanilla javascript snippet
.theme input {
display: none;
}
.theme {
margin: 0 0.3em 0 0;
}
.theme input + label {
color: #f90;
@petermolnar
petermolnar / backup-github.sh
Last active September 3, 2020 20:25
backup-github
#!/usr/bin/env bash
function usage () {
echo "backup-github.sh
A tiny bash script to backup own and starred public github repositories
Usage:
backup-github.sh GITHUB_USERNAME DIRECTORY_TO_BACKUP_TO"
exit 1
@petermolnar
petermolnar / logs2pidgin.py
Last active March 4, 2018 21:09
Python script to convert varios logs (MSN Plus!, Skype v2, Trillian v3, etc) to Pidgin
import os
import sqlite3
import logging
import re
import glob
import sys
import hashlib
import arrow
import argparse
from bs4 import BeautifulSoup
@petermolnar
petermolnar / unfix-all-the-toolbars.user.js
Last active June 29, 2022 07:25 — forked from vbuaraujo/unfix-all-the-toolbars.user.js
GreaseMonkey script to remove "position: fixed" from webpages
// ==UserScript==
// @name unfix-all-the-toolbars
// @description Removes "position: fixed" style from elements, unfixing "toolbars" and the such.
// @namespace http://inf.ufrgs.br/~vbuaraujo/
// @include *
// @version 1.2
// @grant none
// ==/UserScript==
@petermolnar
petermolnar / wp-cron
Last active January 5, 2018 10:42
cron file for wordpress backup and wp-cron using wp-cli
MAILTO="you@domain.com"
SHELL=/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
# prerequisities:
# sudo wget -q -O/usr/local/bin/wpcli https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; sudo chmod 0755 /usr/local/bin/wpcli
# WP CRON
* * * * * wpuser cd /path/to/wordpress; wpcli cron event run --due-now --quiet