Skip to content

Instantly share code, notes, and snippets.

View 1011X's full-sized avatar
🏠
Working from home

Infra 1011X

🏠
Working from home
View GitHub Profile
@1011X
1011X / dmcolor.py
Created October 11, 2018 07:38
Encodes 3 strings into a colorful DataMatrix barcode
#!/usr/bin/env python3
# pip requirements:
# * Pillow 5.3.0
# * pylibdmtx 0.1.8
# license: BSD 0-clause
# This script encodes Data Matrix barcodes into each CMY color channel.
@1011X
1011X / bnf.rs
Created February 16, 2017 02:12
Basic Backus-Naur form grammar macro
macro_rules! bnf {
(<$id:ident> ::= <$p1:ident> | <$p2:ident>; $($t:tt)*) => {
fn $id(i: &'static str) -> (&str, &str) {
let p1 = ::std::thread::spawn(move || $p1(i));
if p1.join().is_ok() {
$p1(i)
} else {
$p2(i)
}

Keybase proof

I hereby claim:

  • I am 1011X on github.
  • I am 1011x (https://keybase.io/1011x) on keybase.
  • I have a public key whose fingerprint is 299B 8CE4 D687 6720 4245 D1CC DE24 2A9C 688D DFF0

To claim this, I am signing this object: