Skip to content

Instantly share code, notes, and snippets.

@paliwodar
paliwodar / build.gradle
Created September 2, 2020 07:52
Gradle test logging
test {
testLogging {
events "skipped", "failed", "standardError"
def outputCache = new LinkedList<String>()
beforeTest { TestDescriptor td -> outputCache.clear() } // clear everything right before the test starts
onOutput { TestDescriptor td, TestOutputEvent toe -> // when output is coming put it in the cache
outputCache.add(toe.getMessage())
@paliwodar
paliwodar / handler.clj
Created May 9, 2017 22:28
clojure-hello
(ns clojure-hello.handler
(:require [compojure.core :refer :all]
[compojure.route :as route]
[compojure.handler :as handler]))
(defroutes app-routes
(GET "/greeting" [name] (str "Hello, " (or name "World") "!"))
(route/not-found "Not Found"))
(def app
@paliwodar
paliwodar / ExampleSpec.groovy
Last active May 24, 2018 10:58
A simple implementation of retry mechanism in Groovy
class SpecFile extends Specification {
def "Order delivery example test case"() {
given:
def product = createProduct()
expect:
retry { user pay product } waiting 500 upTo 3000 until {
it?.responseData?.status == "success"
}
#!/bin/bash
# remove existing rules and set defaults
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT DROP
@paliwodar
paliwodar / _etc_default_isc-dhcp-server
Last active June 6, 2016 03:31
Setting up my Raspberry Pi 3 (Edimax EW-7811Un) access point that is facing the Internet
...
INTERFACES="wlan0"