Skip to content

Instantly share code, notes, and snippets.

simon place splace

  • Cornwall, UK
View GitHub Profile
@splace
splace / find
Last active Dec 11, 2019
gedit tool to search go-lang package files for text and produce clickable links to the files/lines found.
View find
#!/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 Feb 8, 2019
convert wildcard positional to equivalent regexp string match
View convert.go
// 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 Oct 5, 2017
shell; get item from a commands output and use as a parameter in another command.
View gist:d7188b9199cf71fad6a3505dd731f40b
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)
You can’t perform that action at this time.