Skip to content

Instantly share code, notes, and snippets.

@Markcial
Markcial / img_to_b64.fish
Created February 22, 2023 14:20
Converts any given image to b64 and sends the string to the clipboard
function img_to_b64
argparse h/help i/input= -- $argv
if set -ql _flag_help
echo "img_to_b64: Stores the image as b64 string into the clipboard [-h|--help] [-i|--input The input image, relative or absolute]"
return 0
end
if not set -q _flag_input
echo "img_to_b64: No input image specified"
return 1
end
@Markcial
Markcial / save_b64_image.fish
Last active February 22, 2023 14:20
Stores the base64 string stored in the clipboard as an image
function save_b64_image
argparse h/help o/output= -- $argv
if set -ql _flag_help
echo "save_b64_image: Stores the clipboard string as an image [-h|--help] [-o|--output The output image, relative or absolute]"
return 2
end
if not set -q _flag_output
echo "save_b64_image: Missing output image"
return 1
end
@Markcial
Markcial / fyne wizard test
Created October 16, 2020 15:16
Fyne wizard screen
package main
import (
"fyne.io/fyne"
"fyne.io/fyne/app"
"fyne.io/fyne/layout"
"fyne.io/fyne/widget"
)
var (
set -xg FOO bar
@Markcial
Markcial / gist:6b34f9e2773e59722fe2cd8cb244198e
Created June 21, 2019 12:16
MeatFree Chili (Spicy or not)
Ingredients for 2
=================
1/2 Onion
2 garlic cloves
2 tbsp Paprika
1 shot tequila
2 glasses of water
100 gr black or red beans
@Markcial
Markcial / Dockerfile
Created February 22, 2018 09:47
Debian build for fisherman from a debian stretch box
FROM debian:stretch
ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
# essentials
RUN apt-get update \
&& apt-get install -y ca-certificates apt-transport-https locales lsb-release git wget curl gnupg2 bzip2 --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

Keybase proof

I hereby claim:

  • I am Markcial on github.
  • I am markcial (https://keybase.io/markcial) on keybase.
  • I have a public key whose fingerprint is EF6A C95A 0322 655E ADC1 507C 8EE0 DCE1 B9CD 7B0B

To claim this, I am signing this object:

function docker-find --description 'Finds a container by hostname'
set -l hosts
set -l hostname $argv[1]
for container in (docker ps -a -q)
if test (docker inspect --format "{{ .Config.Hostname }}" $container) = $hostname
echo $container
end
end
return 1
end
function string -d "backwards compatibility string function" -a action
set -e argv[1]
switch $action
case length
echo -ne "$argv" | wc -c | xargs
return
case sub
set -l start 0
set -l length
set -l haystack
function mock
set -l _mock $argv[1]
set -l prefix __"$_mock"
set -l result_var "$prefix"_result
set -l body_var "$prefix"_body
set -g "$result_var" 0
if test (count $argv) -ge 2
set "$result_var" $argv[2]
end
set -g "$body_var"