Skip to content

Instantly share code, notes, and snippets.

@roundand
roundand / OpenWithSublimeText3.bat
Last active June 29, 2024 01:16 — forked from mrchief/LICENSE.md
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@roundand
roundand / MinimalEchoServer.md
Last active June 20, 2024 12:36
Minimal Busybox-compatible echo server (also good for Alpine)

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)
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 December 4, 2018 12:31
Doing a command-line demo of the karate API test framework using pre-compiled JARs

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
@roundand
roundand / SketchSystems.spec
Created August 3, 2018 13:22
My Awesome Sketch
My Awesome Sketch
First State
some event -> Second State
Second State
@roundand
roundand / makefile
Last active December 19, 2017 07:37
Generating ad-hoc GOPATH and relative working directory from current working directory
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 December 4, 2017 23:16
godog Dockerfile
FROM golang
RUN go get github.com/DATA-DOG/godog/cmd/godog
WORKDIR /go/godog
CMD ["godog"]
@roundand
roundand / VimCheats.md
Last active July 27, 2017 19:29
Vim cheatsheet

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 / CallPowerShell.linq
Last active April 26, 2017 08:02
LinqPad demo of how to call PowerShell from C#, passing in parameters and receiving a hashtable response
<Query Kind="Statements">
<GACReference>System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</GACReference>
<Namespace>System.Management.Automation</Namespace>
</Query>
// create a powershell session
PowerShell ps = PowerShell.Create();
// add a script to emit a PowerShell hashtable which includes a parameter value
ps.AddScript("param($target); Write-Output @{hello = $target}");
@roundand
roundand / echoDump.go
Last active December 14, 2016 15:56
echoDump can bind to any hostname and port, and responds to all accepted queries by echoing a dump of the incoming request.
// 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"