The following snippet contains an example for GoLang Generics for Structs:
package main
import "fmt"
// Structs definition
type ObjectOne struct {
Name string `json:"name"`
if [ ! -f .env ] | |
then | |
export $(cat .env | xargs) | |
fi |
// A generic doubly-linked list | |
package list | |
// the zero value is ready to use. | |
type List[T any] struct { | |
root Element[T] | |
Len int | |
} |
The following snippet contains an example for GoLang Generics for Structs:
package main
import "fmt"
// Structs definition
type ObjectOne struct {
Name string `json:"name"`
or might be easy with gdisk/fdisk ? I'm not sure about this.
------------------------------------------------------------------------
see the reference for more detail, if you want.
https://richardstechnotes.wordpress.com/2015/12/18/setting-up-an-nvme-ssd-on-ubuntu-14-04-lts/
http://takatakamanbou.hatenablog.com/entry/2015/10/25/235600 : Japanese website
#!/bin/bash | |
# (c) 2020 Artur.Klauser@computer.org | |
# SPDX-License-Identifier: Apache-2.0 OR MIT | |
# | |
# This script installs support for building multi-architecture docker images | |
# with docker buildx on CI/CD pipelines like Github Actions or Travis. It is | |
# assumed that you start of with a fresh VM every time you run this and have to | |
# install everything necessary to support 'docker buildx build' from scratch. | |
# | |
# Example usage in Travis stage: |
--label "traefik.enable=true" \ | |
--label "traefik.protocol=http" \ | |
--label "traefik.first.port=80" \ | |
--label "traefik.first.frontend.rule=Host:web1.example.com" \ | |
--label "traefik.second.port=8080" \ | |
--label "traefik.second.frontend.rule=Host:web2.example.com" \ | |
Above labels will allow us to forward web1.example.com to docker container port 80 and web2.example.com to same container's port 8080 |
Since v8.1 (May 2018), Vim has shipped with a built-in terminal. See https://vimhelp.org/terminal.txt.html or type :help terminal
for more info.
Why use this? Mainly because it saves you jumping to a separate terminal window. You can also use Vim commands to manipulate a shell session and easily transfer clipboard content between the terminal and files you're working on.
# fshow - git commit browser (enter for show, ctrl-d for diff, ` toggles sort) | |
fshow() { | |
local out shas sha q k | |
while out=$( | |
git log --graph --color=always \ | |
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" | | |
fzf --ansi --multi --no-sort --reverse --query="$q" \ | |
--print-query --expect=ctrl-d --toggle-sort=\`); do | |
q=$(head -1 <<< "$out") | |
k=$(head -2 <<< "$out" | tail -1) |
# Assumptions | |
# 1. Your schema implements the Relay Query.node(id:) field, Schema.id_from_object, and Schema.object_from_id | |
# 2. The types you wish to test implement the Node interface | |
# 3. (In order to be compatible with Node) the object you test resolves to a single type | |
# 4. The object you wish to test has a unique identifier | |
# TODO | |
# Maybe we can remove 3. by making use of an override in context? | |
# Since Schema.resolve_type takes a context object, perhaps if you must test an object that is | |
# presented via multiple types in the schema, you can force the decision via context. I have not |
# RIPGREP config (this is the environment variable that vim is reading when building the rg command) | |
# In this case the shell is zsh. Adjust accordingly based on preferred shell and needs. | |
export RG_COMMAND_BASE='rg --ignore-file ~/.ignore --hidden --follow' | |
# Minimal FZF config. Shares the RG_COMMAND_BASE env var. | |
[ -f $HOME/.fzf.zsh ] && source $HOME/.fzf.zsh | |
export FZF_DEFAULT_COMMAND="$RG_COMMAND_BASE --files" |