Skip to content

Instantly share code, notes, and snippets.

View pserwylo's full-sized avatar

Peter Serwylo pserwylo

View GitHub Profile
@pserwylo
pserwylo / colourify.php
Created November 7, 2012 22:30
Divided or not? How the counties voted at the 2012 US election
<?php
/**
* Did some manual data munging of the following dataset:
*
* http://www.guardian.co.uk/news/datablog/2012/nov/07/us-2012-election-county-results-download#data
*
* in libreoffice calc to calculate the percentage of democratic vote (i.e. democratic / ( democratic + republican )), concatenated the county
* and state together so it looked like the "inkscape:label='...'" value in the SVG below and then
* assigned this to a class from colourbrewer (11 diverging classes, using the red and blue variety - note, this is NOT printer friendly):
*
@pserwylo
pserwylo / gist:2c5f4b9fcb7a3808c6b80fdd7ef1475b
Created May 1, 2018 22:19
German words from aspell with upper case letters
Aachen
Aachener
Aachenern
Aacheners
Aachens
Aal
Aale
Aalen
Aales
Aals
@pserwylo
pserwylo / gist:27019d0e12483a8ac227d95d802d37ac
Created May 5, 2018 04:50
German words starting with an upper case letter (from GNU aspell)
Aachen
Aachener
Aachenern
Aacheners
Aachens
Aal
Aale
Aalen
Aales
Aals
@pserwylo
pserwylo / zdf-win.txt
Created June 1, 2018 23:18
A small portion of the Russian dictionary at http://www.speakrus.ru/dict/zdf-win.zip
-äå
-êà
-ëèáî
-íèáóäü
-òàêè
-òî
à
à-êîíòî
à-ëÿ
@pserwylo
pserwylo / dictionary-pl.txt
Created June 3, 2018 21:26
Polish wordlist dumped from GNU Aspell
This file has been truncated, but you can view the full file.
aaa
Aachen
Aachenem
Aachenie
Aachenowi
Aachenu
Aalborg
Aalborgu
Aalto
AAN
@pserwylo
pserwylo / UnicodeToAsciiTruncation.java
Created October 15, 2019 20:46
Java Unicode to ASCII conversion.
import java.text.Normalizer;
class UnicodeToAsciiTruncation {
/**
* Does a best-effort job of converting Unicode to meaningful ASCII characters, by normalizing
* and then truncating any bytes that don't fall within the ASCII range (0-127).
*
* Useful for when you have Unicode data that needs to be sent to a legacy device/service which
* only accepts ASCII (e.g. some specialised printers).
@pserwylo
pserwylo / dictionary.el.txt
Created October 2, 2023 11:31
Lexica potential Greek dictionary created from aspell
This file has been truncated, but you can view the full file.
αάτρευτα
αάτρευτε
αβά
άβα
αβάδων
αβαείο
άβαθα
άβαθε
αβαθείς
αβαθές
aba
abacı
abacılar
abacılığı
abacılık
abadî
abadı
abajur
abajurcu
abajurlar
@pserwylo
pserwylo / dictionary.sv.txt
Created October 8, 2023 09:40
Lexica potential Swedish dictionary created from aspell
åar
åarna
åarnas
åars
åbäka
åbäkade
åbäkar
åbäkat
åbäke
åbäket
@pserwylo
pserwylo / index.html
Created March 12, 2024 11:33
Example card dealing using HTML + CSS
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-7">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>