Skip to content

Instantly share code, notes, and snippets.

@bernardoadc
bernardoadc / .gitalias
Last active March 22, 2022 20:16
GIT Alias
[alias]
ae = !"$(git ed) \"$(git ad)$1.gitalias\" #" # edit a given .gitalias file (or main one)
al = !"afs=($(git afs)) && for n in \"${!afs[@]}\"; do echo \"$n - ${afs[$n]}\"; done && read n && trap 'return' SIGINT && $(git ed) ${afs[$n]} #" # list all .gitalias files + choose one to edit
af = !"git config --global --get-all include.path | grep "/.gitalias" #" # pq grep -l ".gitalias" $(git config --global --get-all include.path) funciona?
afs = !"git config --global --get-all include.path #"
ad = !"echo $(git af) | head -c-10"
alias-sync = !"git -C \"$(git ad)\" pull origin master && git -C \"$(git ad)\" push origin master #"
alias = ae
as = !"git alias-sync #"
au = !"git -C \"$(git ad)\" ac \"$1\" && git as #"
@jineshpaloor
jineshpaloor / pubsub.py
Created September 3, 2015 05:25
Implementation of python pubsub library - publisher subscriber
# -*- coding: utf-8 -*-
#==============================================================================
# Name: pubsub
#
# Purpose: Simple publish & subscribe in pure python
#
# Author: Zhen Wang
#
# Created: 23 Oct 2012
# Copyright: