Skip to content

Instantly share code, notes, and snippets.

View msikma's full-sized avatar
🐛
Writing bugs

Michiel Sikma msikma

🐛
Writing bugs
View GitHub Profile
@msikma
msikma / rfc5646-language-tags.js
Created February 26, 2015 13:51
RFC 5646 Language Tags
// List of language tags according to RFC 5646.
// See <http://tools.ietf.org/html/rfc5646> for info on how to parse
// these language tags. Some duplicates have been removed.
var RFC5646_LANGUAGE_TAGS = {
'af': 'Afrikaans',
'af-ZA': 'Afrikaans (South Africa)',
'ar': 'Arabic',
'ar-AE': 'Arabic (U.A.E.)',
'ar-BH': 'Arabic (Bahrain)',
'ar-DZ': 'Arabic (Algeria)',
// Here's a simple example reducer, a simplified form of what we're using.
// It loads a list of employees.
import * as types from '../actions/action-types'
const initialState = {
hasData: false,
isLoading: false,
entityList: [],
error: null
@msikma
msikma / gmail_operators.md
Last active March 14, 2023 08:51
An overview of Gmail search operators

Gmail search operators

Taken from Google Support on Nov 16, 2018.

Table

What you can search by Search operator and example
Specify the sender from:
Example: from:amy
Specify a recipient to:
Example: tso:david
@msikma
msikma / opl.py
Last active September 22, 2022 23:55
#!/usr/bin/env python2
'''
Short script to make OPL music (in DOSBox DRO files) less loud.
'''
from struct import *
from collections import namedtuple
import sys
import argparse
def namedunpack(data, names, format):
// Webpack config for creating the production bundle.
var path = require('path');
var webpack = require('webpack');
var CleanPlugin = require('clean-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var strip = require('strip-loader');
// Stats plugin.
var writeStats = require('./utils/write-stats');
// ==UserScript==
// @name SumoDB - Rikishi win/loss record highlighter
// @namespace http://sumodb.sumogames.de/
// @version 0.1.1
// @description Highlights wrestlers' kachikoshi records
// @author dada78641
// @match http*://sumodb.sumogames.de/Rikishi.aspx?r=*
// @grant none
// ==/UserScript==
@msikma
msikma / list_all_countries_eu.js
Last active July 10, 2021 10:24
List of all countries – separated, inside European Union and outside EU
/**
* List of countries, with country code (ISO 3166-1), separated by whether
* they're inside or outside the EU. This list has been updated as of
* 2014-12-04, per the list of deleted countries
* at <http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>.
*/
var listAllCountries = {
'insideEU': {
'AT': 'Austria',
// ==UserScript==
// @name iSakura TV - Auto next program
// @namespace http://webtv.jptvpro.net/
// @version 0.1
// @description Automatically activates the next program when your current one finishes playing.
// @author Michiel Sikma <michiel@sikma.org>
// @match http://webtv.jptvpro.net/play.html
// @grant none
// ==/UserScript==
#!/usr/bin/env python3
import unicodedata
with open('SLPS-01144+AREA17+A003.UNGAM_21.html', 'r') as file:
data = file.read()
norm = unicodedata.normalize('NFC', data)
with open('out.html', 'w') as file: