Skip to content

Instantly share code, notes, and snippets.

View loic-roux-404's full-sized avatar
🌮
Trying things

Loïc Roux loic-roux-404

🌮
Trying things
View GitHub Profile
@loic-roux-404
loic-roux-404 / manala.sh
Last active May 5, 2020 21:36
manala fixed install script
#!/bin/sh
CURL=$(which curl)
if [ "$?" = "1" ]; then
echo "You need curl to use this script."
exit 1
fi
VERSION=$(curl -sI https://github.com/manala/manala/releases/latest | grep location | awk -F"/" '{ printf "%s", $NF }' | tr -d '\r')
@loic-roux-404
loic-roux-404 / post-receive
Created June 7, 2020 20:43
deploy hook automation
#!/bin/bash
###
# CONFIG VARS
###
# DO NOT EDIT BELOW UNLESS YOU KNOW WHAT YOU'RE DOING
###
while read oldrev newrev ref
do
@loic-roux-404
loic-roux-404 / install-latest-hugo.sh
Last active November 7, 2020 14:32 — forked from toryalsip/install-latest-hugo.sh
Download latest hugo
#!/bin/bash
# need run as admin
if [ -z $HUGO_VERSION ] ;then
HUGO_VERSION="latest"
API_ENDPOINT="https://api.github.com/repos/gohugoio/hugo/releases/latest"
else
API_ENDPOINT="https://api.github.com/repos/gohugoio/hugo/releases/tags/v$HUGO_VERSION"
fi
HUGO_INSTALL_FILE="/tmp/hugo.deb"
@loic-roux-404
loic-roux-404 / HUGO_COMBINE_MAP_SLICE.md
Last active December 31, 2020 02:36
hugo partials : Deep merge with combination for map and slices

Hugo Map / slice combine

Example usage

Data are converted in json for readability, use go maps in hugo html templates

Base object :
{
"toto": 1, 
@loic-roux-404
loic-roux-404 / settings.json
Last active February 25, 2021 23:16
my vscode settings
{
"window.zoomLevel": 0,
"files.autoSave": "afterDelay",
"workbench.editor.enablePreview": false,
"editor.fontFamily": "'Fira Code', Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"sass.lint.enable": true,
"sass.disableUnitCompletion": false,
"emmet.showSuggestionsAsSnippets": true,
@loic-roux-404
loic-roux-404 / branches.md
Last active March 5, 2021 21:47
Personnal git versionning strategy

branches

According to semantic release

  • 0.0.x --> maintenance release
  • master
  • next
  • next-major
  • beta (prerelease: true)
  • alpha (prerelease: true)

The branches on which releases should happen. By default semantic-release will release:

const defaults = {
// username: '',
grant_type: 'client_credentials',
tokenRoute: "oauth/v2/token"
}
const credentials = {
dev: {
url: 'http://',
client_id: '',
@loic-roux-404
loic-roux-404 / async.go
Last active October 19, 2021 13:37
Concurrent append to store ingo (experiment)
package main
import "fmt"
var store []interface{}
var c = make(chan interface{}, 2) // 2 threads
func asyncAdd(i interface{}) error {
go add(c, i)