Skip to content

Instantly share code, notes, and snippets.

View mkrogemann's full-sized avatar

Markus Krogemann mkrogemann

View GitHub Profile
@mkrogemann
mkrogemann / pattern-remover.sh
Created September 6, 2018 14:30
This little shell script will walk through a directory hierarchy, find given text in matching files and remove the whole line in which the text appears
#!/bin/bash
for thefile in `find <path to start from> -type f -name <filename pattern>` ; do
grep -v "<text to be removed (affects whole line)>" $thefile > $thefile.$$.tmp
mv $thefile.$$.tmp $thefile
done
ps -e -orss=,args= | sort -b -k1,1n
dbms.mode=CORE
dbms.connector.bolt.listen_address=:7691
dbms.connector.http.listen_address=:7481
dbms.connector.https.listen_address=:7371
causal_clustering.initial_discovery_members=localhost:5001,localhost:5002,localhost:5003
causal_clustering.discovery_listen_address=127.0.0.1:5001
causal_clustering.transaction_listen_address=:6001
causal_clustering.raft_listen_address=:7001
@mkrogemann
mkrogemann / loadgtfs.cql
Created December 7, 2016 09:38 — forked from rvanbruggen/loadgtfs.cql
Loading and Querying GTFS data
//LOAD CSV script for GFTS data
create constraint on (a:Agency) assert a.id is unique;
create constraint on (r:Route) assert r.id is unique;
create constraint on (t:Trip) assert t.id is unique;
create index on :Trip(service_id);
create constraint on (s:Stop) assert s.id is unique;
create index on :Stoptime(stop_sequence);
create index on :Stop(name);
schema await
@mkrogemann
mkrogemann / gist:bdbb5fa898547739632a
Last active August 29, 2015 14:12
Scala - Cyclic Iterators sometimes behave badly - this test will loop forever!
import org.scalatest.FlatSpec
class FooSpec extends FlatSpec {
"foo" should "bar" in {
val it = Iterator.continually(List[Int]()).flatten
assert(it.next() == 0)
}
}
@mkrogemann
mkrogemann / gist:5737216
Created June 9, 2013 01:20
'Tannenbaum' in groovy. Tests?
def tree(height, with_star = true) {
if (with_star) println(" " * (left_padding(height, 0) - 1) + "*")
(1..height).each {
ring(it, height)
}
println(" " * (left_padding(height, 0) - 1) + "X")
}
def ring(from_top, height) {
println(" " * left_padding(height, from_top) + "X" * (2 * from_top - 1))
@mkrogemann
mkrogemann / gist:5350319
Last active December 16, 2015 00:49
Ruby's Rational and Complex making me feel uneasy
Stumbling across Rational and Complex for the first time while working with Date/DateTime,
found asking myself: Is there some area for work on these in MRI?
Here is what Ruby Doc says for the Rational class
Rational(-4) ** Rational(1,2) #=> (1.2246063538223773e-16+2.0i)
And here is what my local installation of Ruby 2.0.0 says (same for 1.8.7 and 1.9.3, all on OSX 10.7)
Rational(-4) ** Rational(1,2) #=> (1.2246467991473532e-16+2.0i)
Originally:
https://gist.github.com/7565976a89d5da1511ce
Hi Donald (and Martin),
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I
appreciate the tone. This is a Yegge-long response, but given that you and
Martin are the two people best-situated to do anything about this, I'd rather
err on the side of giving you too much to think about. I realize I'm being very
critical of something in which you've invested a great deal (both financially