Skip to content

Instantly share code, notes, and snippets.

View remcoboerma's full-sized avatar

Remco Boerma remcoboerma

  • Education Warehouse, verZimpel, Dutveul
  • Assen, the Netherlands
View GitHub Profile
@remcoboerma
remcoboerma / youtube-to-mp3-bookmarklet.js
Last active March 6, 2023 07:49
Bookmarklet for downloading the MP3 of a YouTube video.
javascript: window.location = document.URL.replace("youtube", "listentoyoutube").replace("https://", "http://");
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
from __future__ import print_function
from collections import namedtuple
# don't use the semver library, it doesn't work well with compare, sort and those simple things.
# the parse_version result from setuptools does a lot better job.
# found this gem at https://stackoverflow.com/a/21065570/3563630
# Seems to be https://www.python.org/dev/peps/pep-0440/ compliant
from pkg_resources import parse_version
FixInfo = namedtuple('FixInfo', 'seq,fn')
"""
Handlebars exposes [pybars](https://pypi.org/project/pybars4/) as a
Fixture for use with (py4web)[https://www.py4web.com].
The Handlebars class is based on the Template fixture, mimicing it's behaviour.
For example, it will cache the compiled template but invalidate the cache on a changed mdate of the template file.
Example:
# create a partials dictionary.
# each of these precompiled partials can be reused over and over
@remcoboerma
remcoboerma / async_pydal.py
Created June 3, 2021 20:21 — forked from valq7711/async_pydal.py
async_pydal
from pydal import DAL
from voodoodal import DB, Table, Field, model
import aiosqlite
import asyncio
# async sqlexecuter
class SQLExecuter:
def __init__(self, pydal_adapter, adb_executer):
self.adb_executer = adb_executer
self.adapter = pydal_adapter
@remcoboerma
remcoboerma / rtc.py
Created November 23, 2022 21:07 — forked from yuliantoeric/rtc.py
Microbit-Micropython snippet for DS1307 real-time clock
from microbit import i2c
RTC_ADDR = 0x68
def bcd2bin(v):
return v - 6 * (v >> 4)
def bin2bcd(v):
return v + 6 * (v // 10)
@remcoboerma
remcoboerma / tasks.py
Created January 31, 2023 17:28
Multipass tasks.py for my PycharmProjects folder.
from invoke import task
@task
def mp_up(ctx, omgeving, mp_name='dockers'):
ctx.run(f'multipass exec {mp_name} -d {omgeving} ../.local/bin/invoke up', echo=True)
@task
def mp_remount(ctx, mp_name='dockers'):
if mp_name == 'dockers':
ctx.run(f'multipass unmount {mp_name}:', echo=True)

Keybase proof

I hereby claim:

  • I am remcoboerma on github.
  • I am rlboerma (https://keybase.io/rlboerma) on keybase.
  • I have a public key ASCJVIwNFznwphcGvpJgzkVfA_mcFQxty1yst0g1vJ47UAo

To claim this, I am signing this object:

{"menu": {
"id": "file",
"value": "File",
"popup": {
"menuitem": [
{"value": "New", "onclick": "CreateNewDoc()"},
{"value": "Open", "onclick": "OpenDoc()"},
{"value": "Close", "onclick": "CloseDoc()"}
]
}