Skip to content

Instantly share code, notes, and snippets.

View sebastianrothbucher's full-sized avatar

Sebastian Rothbucher sebastianrothbucher

View GitHub Profile
@sebastianrothbucher
sebastianrothbucher / gist:92d6fb6ff382b2ef1370
Last active November 5, 2015 20:34
Other replicator handling (use _replicator, try 2 reliably delete)
git diff test/javascript/tests/replicator_db_bad_rep_id.js | cat
diff --git a/test/javascript/tests/replicator_db_bad_rep_id.js b/test/javascript/tests/replicator_db_bad_rep_id.js
index 8f57eb0..bb6dd30 100644
--- a/test/javascript/tests/replicator_db_bad_rep_id.js
+++ b/test/javascript/tests/replicator_db_bad_rep_id.js
@@ -11,14 +11,16 @@
// the License.
couchTests.replicator_db_bad_rep_id = function(debug) {
- return console.log('TODO');
@sebastianrothbucher
sebastianrothbucher / gist:81d9d70eaeb8178e4a0e
Last active November 5, 2015 21:35
Ideas to test n>1 / config behavior
poss.:
- run 10 times, expect x%
- ensure w=n=3 via ini tweaking (somewhere in dev/run?)
- accept n(=w)=1 ?
- retry-loop
- ... (ideas?!)
needed 4:
- w
- start_delay/start_splay of replicator
- (more?)
@sebastianrothbucher
sebastianrothbucher / byphase.xsl
Last active August 19, 2016 20:29
sth I just rediscovered - build an XML with node-tree, and calc (and put in XSLT afterwards for fancy deliverables). No guarantee 4 correct results but nice still ;-)
<?xml version="1.0"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
@sebastianrothbucher
sebastianrothbucher / log.txt
Created November 30, 2015 20:33
Latest couch JS test run
==> couch_epi (compile)
==> b64url (compile)
==> cassim (compile)
==> meck (compile)
==> couch_log (compile)
==> lager (compile)
==> couch_log_lager (compile)
==> config (compile)
==> chttpd (compile)
==> couch (compile)
it's not about re-usability! - it's about manage-ability (incl. evolve-ability), also in hardening and maintenance phase
Generic code fails at that - and so does sloppy code (even thought it might work in the beginning or 4 "Hello, world!")
@sebastianrothbucher
sebastianrothbucher / SQLiteJDBC.java
Last active January 19, 2016 22:00
Little SQLite parallel test (2x2 in parallel) - should produce 4k recs (adopted from https://github.com/mapbox/node-sqlite3)
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class SQLiteJDBC {
public static void main(String args[]) throws SQLException, ClassNotFoundException {
Connection c = null;
@sebastianrothbucher
sebastianrothbucher / gist:0982b04fbb96707619ac
Created February 7, 2016 15:05
Always flush $httpBackend in ang-Unit-Tests
// otherwise, some bad stuff occurs that takes HOURs to debug
// take that (condensed from several files):
$q.when("hey").then(function(v){console.log(v);}); // prints "hey"
$http.get("something").then(function(){/* do something */});
// no flush
$q.when("hey").then(function(v){console.log(v);}); // prints NOTHING b/c function(v) NEVER gets called
// resolved via
$q.when("hey").then(function(v){console.log(v);}); // prints "hey"
$http.get("something").then(function(){/* do something */});
$httpBackend.flush();
@sebastianrothbucher
sebastianrothbucher / gist:69de7c7086c3db88ce36
Created February 10, 2016 14:44
a promise is a promise
// prepare
var adef=Promise.defer();
var bdef=Promise.defer();
var a=adef.promise;
var b=bdef.promise;
a.then(function(){console.log("A");});
b.then(function(){console.log("B");});
var ab=Promise.all([a, b]);
ab.then(function(){console.log("AB");});
// stop here
@sebastianrothbucher
sebastianrothbucher / SQLiteJDBCBlob.java
Created February 17, 2016 14:01
Another SQLite performance test: 3 GB w/ blobs (VS w/out)
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
@sebastianrothbucher
sebastianrothbucher / gist:cd06bf76562bedbd9d45
Created February 26, 2016 12:21
Write 2 plain TCP (like netcat would)
$ node -e 'var net=require("net"); var client=net.connect({port: 1881}, function(){client.write("hey"); client.end();}); '