Skip to content

Instantly share code, notes, and snippets.

View passy's full-sized avatar
😷
Wear a mask.

Pascal Hartig passy

😷
Wear a mask.
View GitHub Profile
23:13:46, 12 Apr. ( 403.840000) Admin login successful by 192.168.1.116 on HTTP
23:13:07, 12 Apr. ( 364.990000) DSL is down after 0 minutes uptime
23:13:07, 12 Apr. ( 364.990000) ETHoA is down after 0 minutes uptime
23:13:06, 12 Apr. ( 364.170000) ETHoA is up -​ VPI: 0, VCI:35
23:13:06, 12 Apr. ( 364.170000) DSL is up
23:13:04, 12 Apr. ( 362.760000) DSL noise margin: 0.00 dB upstream, 0.00 dB downstream
23:13:04, 12 Apr. ( 362.740000) DSL line rate: 0 Kbps upstream, 5335 Kbps downstream
23:12:44, 12 Apr. ( 342.690000) CWMP: session closed due to error: Could not resolve host
23:12:44, 12 Apr. ( 342.670000) CWMP: Server URL: https://pbthdm.bt.mo; Connecting as user: ACS username
23:12:44, 12 Apr. ( 342.660000) CWMP: Session start now. Event code(s): '4 VALUE CHANGE'
$ unzip -l android/build/outputs/aar/sonar-release.aar | rg jni
0 02-01-1980 00:00 jni/
0 02-01-1980 00:00 jni/arm64-v8a/
1005520 02-01-1980 00:00 jni/arm64-v8a/libc++_shared.so
276584 02-01-1980 00:00 jni/arm64-v8a/libevent.so
182056 02-01-1980 00:00 jni/arm64-v8a/libevent_core.so
276584 02-01-1980 00:00 jni/arm64-v8a/libevent_extra.so
3062960 02-01-1980 00:00 jni/arm64-v8a/libfolly.so
161680 02-01-1980 00:00 jni/arm64-v8a/libglog.so
961288 02-01-1980 00:00 jni/arm64-v8a/librsocket.so
@passy
passy / collapse.hs
Last active February 3, 2018 19:27
data Tree a = Empty | Node a (Tree a) (Tree a)
deriving Show
type IntTree = Tree Int
collapse :: IntTree -> [Int]
collapse t =
case t of
Empty -> [-1]
Node a Empty r -> a : -1 : collapse r
data Tree a = Empty | Node a (Tree a) (Tree a)
deriving Show
type IntTree = Tree Int
collapse :: IntTree -> [Int]
collapse t =
case t of
Empty -> [-1]
Node a Empty r -> a : -1 : collapse r
#!/usr/bin/env python
import sys
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("file")
args = parser.parse_args()
@passy
passy / Term.kt
Last active November 19, 2017 22:10
sealed class Term
data class Num(val n: Int) : Term()
data class Var(val name: String) : Term()
data class Mul(val l: Term, val r: Term) : Term()
data class Add(val l: Term, val r: Term) : Term()
fun simplify(term: Term): Term =
when (term) {
Mul(Num(0), x) -> Num(0),
Mul(Num(1), x) -> x,
Verifying my Blockstack ID is secured with the address 18Uquf8bAjtNmV3DeTccAWpZZrVzG6Ba6E https://explorer.blockstack.org/address/18Uquf8bAjtNmV3DeTccAWpZZrVzG6Ba6E
commit 9957e3b5fae1cd14a7173811253dc11769729869
Author: Pascal Hartig <phartig@rdrei.net>
Date: Wed Oct 25 10:00:42 2017 +0100
Remove now redundant @JvmStatic
diff --git a/sample-kotlin/src/main/java/com/fblitho/lithoktsample/lithography/components/FavouriteButtonSpec.kt b/sample-kotlin/src/main/java/com/fblitho/lithoktsample/lithography/components/FavouriteButtonSpec.kt
index 7a1178d20..9822060da 100755
--- a/sample-kotlin/src/main/java/com/fblitho/lithoktsample/lithography/components/FavouriteButtonSpec.kt
+++ b/sample-kotlin/src/main/java/com/fblitho/lithoktsample/lithography/components/FavouriteButtonSpec.kt

I had a fun refactoring example in Haskell today I wanted to share. So, I've got a structure with a nested Maybe inside, which looked like this:

Maybe (Vector.Vector (Maybe (Direction, [Departure])))

I wanted to get that second-level Maybe folded into the first as it didn't provide any semantic meaning. So I start by writing the type definition:

public class TestClass {
public static void main(String... args) {
new Inner();
}
// Private class, package-level constructor.
private static class Inner {
Inner() {
System.out.println("Hello, world.");
}