Skip to content

Instantly share code, notes, and snippets.

View splace's full-sized avatar

simon place splace

  • Cornwall, UK
View GitHub Profile
@splace
splace / find
Last active December 11, 2019 17:17
gedit tool to search go-lang package files for text and produce clickable links to the files/lines found.
#!/bin/sh
# [Gedit Tool]
# Name=find
# Languages=go
# Input=nothing
# Output=output-panel
# Applicability=all
# Save-files=nothing
# Shortcut=<Primary><Shift>f
@splace
splace / convert.go
Last active February 8, 2019 00:08
convert wildcard positional to equivalent regexp string match
// see working example:- https://play.golang.org/p/W5e7rMv6nXv
func WildcardRegExp(w string) string {
return "^" + strings.NewReplacer(
".", "\\.", // escape regexp special chars...
"^", "\\^",
"$", "\\$",
"+", "\\+",
"(", "\\(",
")", "\\)",
@splace
splace / gist:d7188b9199cf71fad6a3505dd731f40b
Last active October 5, 2017 20:05
shell; get item from a commands output and use as a parameter in another command.
example: test a group of files to see if together their hash is below a specified number;
cat * | sha512sum | tr " " "\n" | head -n 1 | [[ "`xargs echo $1`" < "00000001" ]]
(sha512sum always adds a file name on the same line, making this kind of stuff necessery)