Skip to content

Instantly share code, notes, and snippets.

View claudiosteuernagel's full-sized avatar

Cláudio Steuernagel claudiosteuernagel

View GitHub Profile
@giggio
giggio / Add Windows Terminal Open here.reg
Created February 12, 2021 17:00
This adds Context menus for directories and directories background to open in Windows Terminal
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\WT]
@="Open Windows Terminal here"
"Icon"="C:\\p\\terminal\\src\\cascadia\\CascadiaPackage\\bin\\x64\\Release\\AppX\\WindowsTerminal.exe"
[HKEY_CLASSES_ROOT\Directory\shell\WT\command]
@="wtd.exe -w 1 new-tab -d \"%V\""
[HKEY_CLASSES_ROOT\Directory\shell\WTU]
@giggio
giggio / links.md
Last active April 20, 2022 21:03
Links palestra "Usando um ambiente Linux completo no Windows com WSL e VSCode"
@giggio
giggio / settings.json5
Last active April 30, 2024 00:22
Giovanni Bassi's Windows terminal config
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema-preview",
// "$schema": "https://raw.githubusercontent.com/microsoft/terminal/main/doc/cascadia/profiles.schema.json", // canary
// "$schema": "https://aka.ms/terminal-profiles-schema-preview", // preview
// "$schema": "https://aka.ms/terminal-profiles-schema", // stable
"actions": [
{
"command": {
"action": "moveFocus",
@psxvoid
psxvoid / delete-evicted-pods-all-namespaces.sh
Created August 6, 2018 14:41
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
#!/bin/sh
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d
# delete all evicted pods from all namespaces
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff state from all namespaces
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces
function Update-AssemblyInfoVersionFiles
{
Param
(
[Parameter(Mandatory=$true)]
[string]$productVersion
)
$buildNumber = $env:BUILD_BUILDNUMBER
if ($buildNumber -eq $null)
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active July 4, 2024 15:00
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@pgilad
pgilad / Instructions.md
Last active March 31, 2024 22:30
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

When you modify a file in your repository, the change is initially unstaged. In order to commit it, you must stage it—that is, add it to the index—using git add. When you make a commit, the changes that are committed are those that have been added to the index.

git reset changes, at minimum, where your current branch is pointing. The difference between --mixed and --soft is whether or not your index is also modified. So, if we're on branch master with this series of commits:

- A - B - C (master)

HEADpoints to C and the index matches C.

--soft

@rdeavila
rdeavila / git-update-fork.sh
Last active June 28, 2024 13:53
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
@marioizquierdo
marioizquierdo / git-commit-msg-jira-trello.rb
Last active July 3, 2018 11:24
git hook commit message for JIRA and Trello branches
#!/usr/bin/env ruby
#
# Git commit-msg hook.
#
# If your branch name is in the form "story/DIO-1234/description",
# automatically adds "DIO-1234/description: " to commit messages, unless they mention "DIO-1234" already.
#
# If your branch name is in the form "mario/1234-my-trello-card",
# automatically adds "1234-my-trello-card: " to commit messages, unless they mention "1234" already.
#