Skip to content

Instantly share code, notes, and snippets.

View jmg-duarte's full-sized avatar
📦
Producing blocks...

José Duarte jmg-duarte

📦
Producing blocks...
View GitHub Profile
@palashmon
palashmon / Readme.md
Created February 19, 2024 08:30
Display A List Of Git Branches Ordered By Most Recent Commits

Display A List Of Git Branches Ordered By Most Recent Commits

This file provides commands to display a list of Git branches ordered by the 20 most recent commits, both locally and including remote branches. These commands are helpful for developers to easily track recent activity in the repository.

Show Local Git Branches

To view a list of local Git branches sorted by commit date, use the following command:

git for-each-ref --count=20 --sort=-committerdate refs/heads --format='%(authordate:short) %(color:red)%(objectname:short) %(color:yellow)%(refname:short)%(color:reset) (%(color:green)%(committerdate:relative)%(color:reset))'
@Kestrer
Kestrer / how-to-write-hygienic-macros.md
Created October 17, 2020 05:35
A guide on how to write hygienic Rust macros

How to Write Hygienic Rust Macros

Macro hygiene is the concept of macros that work in all contexts; they don't affect and aren't affected by anything around them. Ideally all macros would be fully hygienic, but there are lots of pitfalls and traps that make it all too easy to accidentally write unhygienic macros. This guide attempts to provide a comprehensive resource for writing the most hygienic macros.

Understanding the Module System

First, a little aside on the details of Rust's module system, and specifically paths; it is

@fnky
fnky / ANSI.md
Last active April 25, 2025 13:38
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active April 11, 2025 08:16
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@soarez
soarez / .tmux.conf
Last active May 5, 2022 08:58
My messy tmux conf
# use b as prefix
set-option -g prefix C-b
unbind-key C-a
bind-key C-b send-prefix
# Start numbering at 1
set-option -g base-index 1
# Allows for faster key repetition
set-option -g escape-time 0