Feature | Unit tests | Instrumetation test | |
---|---|---|---|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Boolean logic "AND" and "OR" matcher composed of two other matchers | |
*/ | |
data class AndOrMatcher<T : Any>( | |
val and: Boolean, | |
val first: T, | |
val second: T | |
) : Matcher<T>, CompositeMatcher<T>, CapturingMatcher { | |
override val operandValues: List<T> | |
get() = listOf(first, second) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class ListWithoutOrderMatcher<T>( | |
val expectedList: List<T>, | |
val refEq: Boolean | |
) : Matcher<List<T>> { | |
val map = buildCountsMap(expectedList, refEq) | |
override fun match(arg: List<T>?): Boolean { | |
if (arg == null) return false | |
return buildCountsMap(arg, refEq) == map | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.github.oleksiyp.proxy.controller | |
import io.github.oleksiyp.netty.JsonScope | |
import io.github.oleksiyp.netty.RequestHttpHandlerScope | |
import io.github.oleksiyp.proxy.service.ProxyConnection | |
import io.github.oleksiyp.proxy.service.ProxyOps | |
import io.kotlintest.matchers.shouldBe | |
import io.kotlintest.specs.StringSpec | |
import io.netty.handler.codec.http.HttpMethod | |
import io.netty.handler.codec.http.HttpResponseStatus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f -print0 | \ | |
while IFS='' read -r -d '' x; do | |
d=$(date -r "$x" +%Y-%m-%d) | |
mkdir -p "$d" | |
mv -f "$x" "$d/" | |
done | |
#System Design Cheatsheet
Picking the right architecture = Picking the right battles + Managing trade-offs
##Basic Steps
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# required: | |
# sudo apt-get install inotify-tools | |
temp_dir=`mktemp -d` | |
target_host="...CHANGE..." | |
target_remote_dir="...CHANGE..." | |
pid="not_a_pid" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dataxu.learn.etl.repacking_tool; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.IdentityHashMap; | |
import java.util.List; | |
import java.util.Map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.silverrail.utils; | |
import java.io.StringWriter; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class UncaughtExceptionHandlerForHumans implements Thread.UncaughtExceptionHandler { | |
@Override | |
public void uncaughtException(Thread t, Throwable e) { | |
List<Throwable> chain = new ArrayList<>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dig @208.67.222.220 myip.opendns.com | grep -A 1 "ANSWER SECTION" | tail -n 1 | cut -f 5 |
NewerOlder