Skip to content

Instantly share code, notes, and snippets.

View kneth's full-sized avatar

Kenneth Geisshirt kneth

View GitHub Profile

Keybase proof

I hereby claim:

  • I am kneth on github.
  • I am kneth (https://keybase.io/kneth) on keybase.
  • I have a public key ASBtpYgZKAjz0We-EXhwFK-x3MVqkZ74FcTiELSuTE68TAo

To claim this, I am signing this object:

@kneth
kneth / bingo.sh
Created April 4, 2020 12:07
Bingo in BASH
echo $(seq 1 90) | tr " " "\n" | while read i; do printf "%06d %s\n" $RANDOM $i; done | sort -n | cut -c8- | while read n; do echo $n ; sleep 5 ; done
@kneth
kneth / gist:d892973141e09fa12276ba7fc13c98f4
Created May 4, 2016 11:27
"git diff" for updated app
diff --git a/app/build.gradle b/app/build.gradle
index 169734a..96caf6e 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -32,4 +32,5 @@ dependencies {
compile 'io.reactivex:rxjava:1.1.0'
compile 'com.google.dagger:dagger:2.0.2'
provided 'org.glassfish:javax.annotation:10.0-b28'
+ compile 'com.github.realm:realm-android-adapters:v1.0.0'
}
@kneth
kneth / gist:7cbad830461e57ffbe0d
Created January 20, 2015 13:55
Scheduled queries
private void runSingleThread(ScheduledExecutorService scheduler, final AllTypes allTypes) {
testRealm.beginTransaction();
allTypes.setColumnLong(1);
testRealm.commitTransaction();
Log.d("REALM", "runSingleThread");
scheduler.schedule(new Runnable() {
@Override
public void run() {
Log.d("REALM", "run");
@kneth
kneth / opg1A.py
Created June 12, 2013 07:23
Opgave 1A
import random
antal_ens = 0
for _ in range(0, 5000000):
centicubes = ['R', 'H', 'R']
random.shuffle(centicubes)
c1 = centicubes.pop(random.randint(0, len(centicubes)-1))
c2 = centicubes.pop(random.randint(0, len(centicubes)-1))
if c1 == c2:
antal_ens += 1