Skip to content

Instantly share code, notes, and snippets.

View bbjubjub2494's full-sized avatar

Julie B. bbjubjub2494

View GitHub Profile
# Copyright Lourkeur 2016
#
# This module defines the python class Chronometer.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@bbjubjub2494
bbjubjub2494 / cleanup
Last active March 20, 2017 21:41
issue21
#!/bin/sed -f
/Parent PID/d
s/^==[0-9]*== //
@bbjubjub2494
bbjubjub2494 / conway.py
Last active November 10, 2017 13:21
functional conway game of life using sets
#!/usr/bin/env python3
"""Python 3.6 KISS implementation of Conway's game of life
Inspired by Stop Writing Classes by Jack Diederich,
https://www.youtube.com/watch?v=o9pEzgHorH0
"""
from collections import defaultdict
from itertools import *
from typing import *
@bbjubjub2494
bbjubjub2494 / conway.clj
Last active April 3, 2018 15:48
functional conway game of life using sets
#!/usr/bin/env boot
"Clojure KISS implementation of Conway's game of life
Ported from https://gist.github.com/lourkeur/95799b35e2d3aac54cdd0e4a7c8d2037 (Python)
Patterns from http://conwaylife.com/wiki"
(set-env! :dependencies #(conj % '[org.clojure/clojure "1.9.0"]))
(require '[clojure.spec.alpha :as spec])
(use 'clojure.test)
@bbjubjub2494
bbjubjub2494 / Main$.jad
Created January 13, 2019 20:23
illustrating scala auto{,un}boxing
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3)
// Source File Name: Main.scala
import java.util.function.Function;
import scala.Predef$;
import scala.runtime.BoxesRunTime;
public final class Main$
@bbjubjub2494
bbjubjub2494 / rev.asc
Created February 11, 2020 12:27
Revocation certificate for my 2017 PGP key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: This is a revocation certificate
iQI2BCABCAAgFiEEROVC0lo5kChqc2X+2hFPBEKttNcFAlmAVwgCHQAACgkQ2hFP
BEKttNftkA/+OOWCiNsgNorVVPAv3vOrgmTZS0J3tqBHhCS4JzEiE5ppPxmRzIfn
X0oaeevviSS4tz2wfCZtuTil1v2fbYRCSCFKanhdeNJXFV55WlZy0K2GA3RnFOsv
VjQ4+vpbtwIwjH1WnIS4QqnZmrvnQTJEJidTrnN4N7YWXMPv/WYk3vYlwIrD7geB
H6SyAtUa73jYQmbSfmBm2OgA486ySZ0o7W1ezBu9zTPAXgUdV6kKybQGKkT/Ijoa
mrC5V62ZpSbumcIzV7imHG9N+Pl+03+P8qv6ls0ySPa47703RlIUFrXvR7WNuRQ1
u/0DGS9W4RemNXD3+bgp08rsKepPencxkfaO6g3fy2jXsNQoEBvRI0f5mNRuvABi
import $ivy.`org.typelevel::cats-core:2.1.0`
import cats._
import data.ContT
import syntax.all._
// ContT.liftF, currently unreleased.
def ContT_liftF[M[_]: FlatMap, R, A](ma: M[A]): ContT[M, R, A] =
ContT(ma.flatMap(_))
@bbjubjub2494
bbjubjub2494 / server_util.py
Last active May 17, 2020 14:19
Extract from Xpra source code to be discussed with Nixpkgs users and contributors
# This file is part of Xpra.
# Copyright (C) 2017-2020 Antoine Martin <antoine@xpra.org>
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
# later version. See the file COPYING for details.
import sys
import os.path
from xpra.util import envbool
from xpra.os_util import OSX, POSIX, shellsub, getuid, get_util_logger, osexpand, umask_context
@bbjubjub2494
bbjubjub2494 / build.sbt
Created May 26, 2020 15:13
showcase dotty crash
val dottyVersion = "0.24.0-RC1"
scalaVersion := dottyVersion
scalacOptions ++= Seq(
"-deprecation",
"-feature",
"-Xfatal-warnings",
"-encoding", "utf8",
"-Yexplicit-nulls",
)
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
public class poc {
private static final String ALPHA_UPPER_CASE = "abcdefghijklmnopqrstuvwxyz".toUpperCase();
private static final String NUMERIC= "0123456789";