Skip to content

Instantly share code, notes, and snippets.

View MetalBlueberry's full-sized avatar

Victor MetalBlueberry

View GitHub Profile
@tomlankhorst
tomlankhorst / docker-swarm-gpu.md
Last active June 13, 2024 19:00
Instructions for Docker swarm with GPUs
@dnephin
dnephin / logging.go
Last active November 15, 2019 16:49
Go - Logger from context.Context
package logging
import (
"context"
"github.com/sirupsen/logrus"
)
type (
fieldsKey struct{}
@JonathanDn
JonathanDn / medium_clap.html
Last active June 9, 2023 07:34
(moved to a repo https://github.com/JonathanDn/mediumclap ) Medium Clap Reproduction - My take on it by looking, researching and trial & error. Demo available --> https://jsfiddle.net/urft14zr/425/
<div class="canvas">
<div id="totalCounter" class="total-counter"></div>
<div id="clap" class="clap-container">
<i class="clap-icon fa fa-hand-paper-o"></i>
</div>
<div id="clicker" class="click-counter">
<span class="counter"></span>
</div>
anonymous
anonymous / Dockerfile
Created October 29, 2017 13:40
FROM base/archlinux
ADD dotfiles/vimrc /root/.vimrc
ADD dotfiles/vim /root/.dotfiles/vim
RUN pacman -Syu --noconfirm && \
pacman -S --noconfirm \
neovim \
git \
python2-neovim \
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@francoishill
francoishill / golang_enums_check_has_flag
Last active May 29, 2023 11:40
Golang enums and checking if the value has a specific flag
package main
type verbosityEnum int
const (
NoneVerbosity verbosityEnum = 1 << iota
ErrorVerbosity verbosityEnum = 2
WarningVerbosity verbosityEnum = 4
InfoVerbosity verbosityEnum = 8
AllVerbosity verbosityEnum = 16
@hyg
hyg / gist:9c4afcd91fe24316cbf0
Created June 19, 2014 09:36
open browser in golang
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@paulmach
paulmach / serve.go
Last active July 20, 2024 04:04
Simple Static File Server in Go
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
*/
package main