Skip to content

Instantly share code, notes, and snippets.

View webflo-dev's full-sized avatar

Florent webflo-dev

View GitHub Profile
@webflo-dev
webflo-dev / gist:5d1a0b0d1fd43d6230eede2e9ddb98a1
Last active June 24, 2021 07:29
GO installation in Dockerfile
# base packages
RUN sudo apt update && \
sudo apt install -y wget build-essential
# install latest Go
RUN wget -q -c "https://dl.google.com/go/$(curl https://golang.org/VERSION?m=text).linux-amd64.tar.gz" -O - | sudo tar xvz -C /usr/local
ENV PATH="/usr/local/go/bin:${PATH}"
@webflo-dev
webflo-dev / README.md
Created June 25, 2021 16:24 — forked from deviantony/README.md
Portainer HTTP API by example

Introduction

This document presents a simple way to manage your Docker resource by using Portainer as a gateway (HTTP queries against the Portainer API).

The API documentation is available here: https://app.swaggerhub.com/apis/deviantony/portainer/

WARNING: This documentation is valid for Portainer >= 1.18.0.

NOTE: I'm using httpie to execute HTTP queries from the CLI.

@webflo-dev
webflo-dev / pacman.md
Last active August 4, 2021 07:16
archlinux - pacman
@webflo-dev
webflo-dev / manjaro-aur-packages.sh
Last active September 30, 2021 17:01
manjaro setup
pamac build direnv
flatpak install spotify
pamac build microsoft-edge-dev-bin
pamac build visual-studio-code-bin
/** Operators */
const map = (mapper) => (reducer) => (acc, val) => reducer(acc, mapper(val));
const filter = (predicate) => (reducer) => (acc, val) =>
predicate(val) ? reducer(acc, val) : acc;
const some = (predicate) => (_) => (acc, val) =>
acc !== true ? predicate(val) : true;
/** */
@webflo-dev
webflo-dev / envup.sh
Created September 19, 2021 10:42
Load env file
envup() {
local file=$([ -z "$1" ] && echo ".env" || echo ".env.$1")
if [ -f $file ]; then
set -a
source $file
set +a
else
echo "No $file file found" 1>&2
return 1
@webflo-dev
webflo-dev / winget-apps.json
Last active December 16, 2021 12:03
winget install
{
"$schema" : "https://aka.ms/winget-packages.schema.2.0.json",
"CreationDate" : "2021-12-16T13:02:46.391-00:00",
"Sources" :
[
{
"Packages" :
[
{
"PackageIdentifier" : "Bitwarden.Bitwarden"
function multiselect {
# little helpers for terminal print control and key input
ESC=$( printf "\033")
cursor_blink_on() { printf "$ESC[?25h"; }
cursor_blink_off() { printf "$ESC[?25l"; }
cursor_to() { printf "$ESC[$1;${2:-1}H"; }
print_inactive() { printf "$2 $1 "; }
print_active() { printf "$2 $ESC[7m $1 $ESC[27m"; }
get_cursor_row() { IFS=';' read -sdR -p $'\E[6n' ROW COL; echo ${ROW#*[}; }
@webflo-dev
webflo-dev / backup.sh
Last active June 15, 2022 13:23
backup gnome archlinux
#!/usr/bin/env bash
date=$(date +"%Y-%m-%d")
source_dir=/home/$USER/
backup_dir=${source_dir}backup_${date}/
mkdir -p ${backup_dir}
dconf dump / > gnome_dconf.conf
tar -zcvf ${backup_dir}gnome_extensions.tar.gz ${source_dir}.local/share/gnome-shell/extensions/