Skip to content

Instantly share code, notes, and snippets.

View gist:5f3fc345630e1bde19bd032eeeabdbc7
Challenging Intro
Glora with Fritz Perls: https://www.youtube.com/watch?v=8y5tuJ3Sojc
confrontational interaction: https://ytcropper.com/cropped/8y5c99dbf9caa7c (3:18)
Getting closer: https://ytcropper.com/cropped/8y5c99e0a8e218c (1:18)
@roundand
roundand / karate-demo.md
Last active Dec 4, 2018
Doing a command-line demo of the karate API test framework using pre-compiled JARs
View karate-demo.md

Not interested in this as Java, so followed isntruction in https://github.com/intuit/karate/blob/master/karate-netty/README.md

  • Ensure Java installed
  • Download karate jar file as described, and rename to karate.jar
  • Download following files into the same directory:
    • cats-mock.fearure
    • cats-test.feature
    • cats.html
  • Open console in directory, and start server with java -jar karate.jar -m cats-mock.feature -p 8080 &
  • Open cats.html as a file link in a web browser, and experiment
View SketchSystems.spec
My Awesome Sketch
First State
some event -> Second State
Second State
@roundand
roundand / makefile
Last active Dec 19, 2017
Generating ad-hoc GOPATH and relative working directory from current working directory
View makefile
xyz = $(shell expr '/home/fn/go/fred' : '\(.*go/\)')
default:
XGP=$$(expr '/home/fn/go/fred' : '\(.*go/\)'); \
echo XGP $$XGP; \
export XWD=$$(expr '/home/fn/go/fred' : '.*/go/\(.*\)'); \
echo XWD $$XWD; \
echo xyz $(xyz)
@roundand
roundand / Dockerfile
Created Dec 4, 2017
godog Dockerfile
View Dockerfile
FROM golang
RUN go get github.com/DATA-DOG/godog/cmd/godog
WORKDIR /go/godog
CMD ["godog"]
@roundand
roundand / MinimalEchoServer.md
Last active Oct 1, 2017
Minimal Busybox-compatible echo server (also good for Alpine)
View MinimalEchoServer.md

Using nc (aka netcat) as a commonly available solution (but this syntax only tested for Alpine):

nc -lkp 8088 -e /bin/cat

nb:

  • -l for listen
  • -k to keep running for multiple calls (unavailable on busybox)
  • -p for port parameter
  • -e for program to execute (in the absence of a filename, cat echoes stdin to stdout)
@roundand
roundand / VimCheats.md
Last active Jul 27, 2017
Vim cheatsheet
View VimCheats.md

Search and Replace

:s/pattern/string/ Replace pattern with string on line

:%s/pattern/string/ Replace pattern with string throughout document

Flags

g Global. Replace all c Confirm i case-insensitive

Copy and Paste

@roundand
roundand / echoDump.go
Last active Dec 14, 2016
echoDump can bind to any hostname and port, and responds to all accepted queries by echoing a dump of the incoming request.
View echoDump.go
// echoDump is a minimal "echo" server that responds with a dump of the incoming request.
// (Based on https://github.com/adonovan/gopl.io/blob/master/ch1/server1/main.go)
package main
import (
"flag"
"fmt"
"log"
"net/http"
"net/http/httputil"
@roundand
roundand / AsyncEvents
Created Jun 13, 2014
Demonstration of Async Event processing in PowerShell v2
View AsyncEvents
# Illustration (based on concepts in http://blogs.technet.com/b/heyscriptingguy/archive/2011/06/16/use-asynchronous-event-handling-in-powershell.aspx
# and code nicked from an answer in http://social.technet.microsoft.com/Forums/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell
# )
#####
#
# PASTE LINES BELOW INTO CONSOLE
#
#
@roundand
roundand / replaceTokens.linq
Last active Aug 29, 2015
linqPad demo of c# Regex extension method to replace tokens in a string using a token / value dictionary
View replaceTokens.linq
<Query Kind="Program" />
// define regex to match $-delimited tokens, eg $name$
static Regex toke = new Regex(@"\$(\w+)\$", RegexOptions.Compiled);
static void Main()
{
string input = @"Dear $name$, as of $date$ your balance is $amount$";
var args = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
args.Add("name", "Mr Smith");