Skip to content

Instantly share code, notes, and snippets.

@martijnluinstra
martijnluinstra / sqlalchemy_filter.py
Last active July 24, 2021 01:21
Python 3 classes for filtering SQLAlchemy queries
"""
This set of Python 3 classes is created to make automatic filtering of
SQLAlchemy queries easier. It is designed to have an api similar to
Django-filter (https://github.com/carltongibson/django-filter).
You may use an modify this code however you like for non-commercial purposes.
I will appreciate it if you mention my name when you do so.
Copyright (c) 2021 Martijn Luinstra
"""
@martijnluinstra
martijnluinstra / Soundboard.js
Last active July 12, 2018 08:18
A simple JavaScript based soundboard
/**
* Some javascript to render a soundboard.
* Demo: https://vakantieracer.com/
*
* You may use an modify this code however you like for non-commercial purposes.
* I will appreciate it if you mention my name when you do so.
*
* Copyright (c) 2018 - Martijn Luinstra
*/
@martijnluinstra
martijnluinstra / invert_po.py
Created June 16, 2018 19:58
A Python 3 script that inverses the translation direction of a .po file and modifies the linked sources.
"""
For our PHP website, I needed to reverse the translation direction of the i18n functionality. The source code was all in
Dutch, but since international people had joined our team it made sense to change it to English in order to make their
work easier. This script was created to ease that process.
Please note that this isn't perfect: it won't correctly escape special characters that are inserted into the code, and
it also won't replace strings that contain escaped characters. It does make the entire process a lot less tedious, though.
Copyright (c) 2018 Martijn Luinstra
"""
@martijnluinstra
martijnluinstra / iban.py
Last active October 10, 2017 01:20
Dutch IBAN generator
"""
Python 3 Generator for Dutch IBANs.
Should be equivalent to gist.github.com/martijnluinstra/9ca0f62b9ddc01288be8a6072d29b029
Demo: projects.martijnluinstra.nl/iban/
Copyright (c) 2017 Martijn Luinstra
"""
import functools
import operator
@martijnluinstra
martijnluinstra / iban.js
Last active May 17, 2022 01:39
Dutch IBAN generator
/**
* Javascript Generator for Dutch IBANs.
* Demo: projects.martijnluinstra.nl/iban/
* Dependencies: https://github.com/MikeMcl/bignumber.js/
*
* Copyright (c) 2017 - Martijn Luinstra
*/
/**
* Converts IBAN to the decimal representation used for validation
@martijnluinstra
martijnluinstra / bootstrap4_theme_tester.html
Last active January 22, 2017 14:46
An html file that contains most of the components of Bootstrap v4.0.0-alpha.6 to make testing of customized styles easier.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../favicon.ico">
<title>Bootstrap 4 Theme Tester</title>