Skip to content

Instantly share code, notes, and snippets.

@j4mie
j4mie / normalise.py
Created August 30, 2010 12:44
Normalise (normalize) unicode data in Python to remove umlauts, accents etc.
# -*- coding: utf-8 -*-
import unicodedata
""" Normalise (normalize) unicode data in Python to remove umlauts, accents etc. """
data = u'naïve café'
normal = unicodedata.normalize('NFKD', data).encode('ASCII', 'ignore')
print normal
@zajdee
zajdee / Digital-Green-Certificate-Dump.py
Last active November 5, 2021 19:15
A simple tool to dump the European Union's COVID passports (Digital Green Certificates)
#!/usr/bin/env python3
# install dependencies:
# pip install base45 cbor2 (cwt - not used here)
import sys
import zlib
from base45 import b45decode
from cbor2 import loads
@Glutexo
Glutexo / gist:5669c06ef54e60684c4433e0a9e29534
Created January 29, 2021 17:22
APA - AstraZeneca.pdf[1].txt
Obsah:
* 2020.08.27 APA - FINAL AZ signature only - Legal Redactions
* 1. Definitions.
* 1.1. “Accounting Standards” means International Financial Reporting Standards (IFRS).
* 1.2. “Additional Doses” has the meaning given in Section 5.3.
@owainlewis
owainlewis / Example.hs
Last active June 1, 2020 20:30
Haskell HTTP GET request example
module Example () where
import Network.HTTP
-- Non HTTPS
-- 1. Perform a basic HTTP get request and return the body
get :: String -> IO String
get url = simpleHTTP (getRequest url) >>= getResponseBody
@bhauman
bhauman / README.md
Last active December 3, 2019 16:43
ClojureScript minimal dev and prod setup.

Recent improvements to the ClojureScript compiler have greatly simplified setting up development versus production outputs.

This example uses Figwheel as something that you want to exclude for production, but the pattern is general.

With this simple setup you only need one html file/view and it will work for developement and production.

@omangin
omangin / nmf_kl.py
Last active August 9, 2019 06:30
Non-negative matrix factorization for I divergence
""" Non-negative matrix factorization for I divergence
This code was implements Lee and Seung's multiplicative updates algorithm
for NMF with I divergence cost.
Lee D. D., Seung H. S., Learning the parts of objects by non-negative
matrix factorization. Nature, 1999
"""
# Author: Olivier Mangin <olivier.mangin@inria.fr>