Skip to content

Instantly share code, notes, and snippets.

View nebiros's full-sized avatar

Juan Alvarez nebiros

View GitHub Profile
@mitchellh
mitchellh / merge_vs_rebase_vs_squash.md
Last active March 27, 2024 12:40
Merge vs. Rebase vs. Squash

I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.

I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:

@candlerb
candlerb / go-project-layout.md
Last active August 2, 2023 17:39
Suggestions for go project layout

If someone asked me the question "what layout should I use for my Go code repository?", I'd start by asking back "what are you building: an executable, or a library?"

Single executable

Stage 1: single source file

Create a directory named however you want your final executable to be called (e.g. "mycommand"), change into that directory, and create the following files:

@justin808
justin808 / .pryrc
Last active January 21, 2024 02:30
Updated .pryrc with option to remove pry-byebug
# Using these pry gems -- copy to your Gemfile
# group :development, :test do
# gem 'awesome_print' # pretty print ruby objects
# gem 'pry' # Console with powerful introspection capabilities
# # pick either:
# # using byebug, but has issues with Zeitwerk
# gem 'pry-byebug' # Integrates pry with byebug
#
# # using default ruby debuggger
# gem 'pry-stack_explorer'
# Referenced videos:
# - Argo CD - Applying GitOps Principles To Manage Production Environment In Kubernetes: https://youtu.be/vpWQeoaiRM4
# - kind - How to run local multi-node Kubernetes clusters: https://youtu.be/C0v5gJSWuSo
# - GitHub CLI - How to manage repositories more efficiently: https://youtu.be/BII6ZY2Rnlc
# - Argo Workflows and Pipelines - CI/CD, Machine Learning, and Other Kubernetes Workflows: https://youtu.be/UMaivwrAyTA
# - Running Jenkins In Kubernetes - Tutorial And Review: https://youtu.be/2Kc3fUJANAc
# - Github Actions Review And Tutorial: https://youtu.be/eZcAvTb0rbA
# - Tekton - Kubernetes Cloud-Native CI/CD Pipelines And Workflows: https://youtu.be/7mvrpxz_BfE
# - Environments Based On Pull Requests (PRs): Using Argo CD To Apply GitOps Principles On Previews: https://youtu.be/cpAaI8p4R60
# - How To Apply GitOps To Everything - Combining Argo CD And Crossplane: https://youtu.be/yrj4lmScKHQ
@eduardoroliveira
eduardoroliveira / gomock.md
Last active April 29, 2022 20:51 — forked from thiagozs/gomock.md
Tutorial gomock

08/16/17 by  Sergey Grebenshchikov

No Comments

This is a quick tutorial on how to test code using the GoMock mocking library and the standard library testing package testing.

GoMock is a mock framework for Go. It enjoys a somewhat official status as part of the github.com/golang organization, integrates well with the built-in testing package, and provides a flexible expectation API.

@toricls
toricls / lima-on-m1-mac-installation-guide.md
Last active February 28, 2024 10:39
Using Lima to run containers with containerd and nerdctl (without Docker Desktop) on M1 Macs

Lima (Linux virtual machines, on macOS) installation guide for M1 Mac.

Sep. 27th 2021 UPDATED

Now we can install patched version of QEMU via Homebrew (thank you everyone for the info!). Here is the updated instruction with it:

Used M1 Mac mini 2020 with macOS Big Sur Version 11.6.

1. Install QEMU & Lima

# Start SSH Service.
wsl sudo service ssh start
# WSL2 network port forwarding script v1
# for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell,
# for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter.
# written by Daehyuk Ahn, Aug-1-2020
# Display all portproxy information
If ($Args[0] -eq "list") {
@tdcosta100
tdcosta100 / WSL2GUIXvnc-en.md
Last active March 8, 2024 07:34
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key component we need to install is tigervnc-standalone-server.

For this setup, I will use Ubuntu 20.04 LTS (Focal Fossa, unfortunately 22.04 does not work), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the Sample screenshots section for examples.

So let's go. First, we need a working WSL2 installation.

@slok
slok / pprof.md
Last active March 24, 2024 17:30
Go pprof cheat sheet

Enable profiling

Default http server

import (
    _ "net/http/pprof"
    "net/http"
)
@gbrow004
gbrow004 / ubuntu-MBP-16.md
Last active March 7, 2024 07:57
Ubuntu on Apple Macbook Pro 16-inch (2019)

Update!

This gist is out of date and I can no longer help much, as I got rid of my Mac.

Please visit T2 Linux website for more and better information:

https://t2linux.org/

Acknowledgements

This gist is just a compilation of the hard work that others have put in. I'm not a software developer, so if there are any mistakes or better ways of doing things, I'd appreciate any suggestions. Here's a list of the real heroes who made this possible: