Feb
6
2016
[lang_en]Git porcelain has improved a lot, it still has a couple of rough spots. Here are a couple of git aliases that make my git workflow more pleasant:[/lang_en]
[lang_pt]A interface de linha de comando do git tem melhorado imenso, mas algumas operações poderiam ter melhor interface. Aqui seguem alguns aliases que tornaram o meu uso de git mais agradável:[/lang_pt]
-
[lang_en]Dealing with aliases[/lang_en][lang_pt]Para gerir aliases[/lang_pt]
1
2
3
4
5git config --global --add alias.add-alias \
'!f() { git config --global --add alias.$1 "$2"; }; f'
git add-alias aliases 'config --get-regexp ^alias'
git config --global --add alias.rm-alias \
'!f() { git config --global --unset alias.$1 ; }; f' -
[lang_en]Basic shortcuts[/lang_en][lang_pt]Atalhos básicos[/lang_pt]
1
2
3
4
5
6
7
8
9git add-alias stat status
git add-alias co checkout
git add-alias ci commit
git add-alias br branch
git add-alias fa 'fetch --all'
git add-alias pullff 'pull --ff-only'
git add-alias pullrb 'pull --rebase'
git add-alias rbi 'rebase -i'
git add-alias bi bisect -
[lang_en]Informational[/lang_en][lang_pt]Atalhos informativos[/lang_pt]
1
2
3
4
5
6git add-alias root 'rev-parse --show-toplevel'
git add-alias wb 'rev-parse --abbrev-ref HEAD'
git add-alias desc 'describe --dirty --abbrev=40'
git add-alias bll 'branch -vv --list'
git add-alias where \
'! echo "* HEAD:" $(git desc); git bll $(git wb)' -
Branches
1
2
3
4git add-alias bup-om \
'branch --set-upstream-to origin/master'
git add-alias cob 'checkout -b'
git add-alias cot 'checkout -b -t' -
[lang_en]Fundamental settings[/lang_en][lang_pt]Opções essenciais[/lang_pt]
1
2
3
4
5git config --global --add push.default simple
git config --global --add core.ui true
git config --global --add core.whitespace \
trailing-space,space-before-tab,tab-in-indent
git config --global --add merge.conflictstyle diff3[lang_en]Of course you must set user.email and user.name. If signing of commits is desired then set user.signingKey.[/lang_en]
[lang_pt]Claro que é obrigatório configurar user.email e user.name. Quando se pretende assinar os commits então também tem que configurar user.signingKey.[/lang_pt]
Oct
19
2013
[lang_en]Previously… Useful bash functions
This new version is a tad more efficient since there are no more echo and pipes involved on the processing. Just one eval and one awk script.
[/lang_en][lang_pt]Previamente… Funções úteis em bash
Esta nova versão é ligeiramente mais eficiente, porque não existem mais comandos echo e pipes envolvidos no processamento. Apenas um eval e um script awk.
[/lang_pt]
1
2
3
4
5
6
7
8
9
10
11
12 unique_path() {
eval $(awk -v VAR="${1}" 'BEGIN { \
if((N=split(ENVIRON[VAR],vals,":"))<2) exit(0); \
sep = out="" ; i=split(out,seen); \
do { if(!(vals[++i] in seen)) { seen[vals[i]]; \
gsub("["]","\\"",vals[i]); \
out=sprintf("%s%s%s",out,sep,vals[i]); \
sep=":"; \
} } while (i<N); \
printf "%s="%s"; export %s;\n",VAR,out,VAR; \
}' /dev/null)
}
[lang_en]Similarly, these also had remove unnecessary uses of sub-shell echo…[/lang_en][lang_pt]Estas funções também foram melhoradas removendo usos desnecessários de sub-shells para echo[/lang_pt]
1
2
3
4
5
6
7
8
9
10
11 safe_prepend_path() {
VAR=$1 ; shift ; eval VAL=\$${VAR}
for i_;do [ -d "$i_" ] && VAL=$i_${VAL:+":$VAL"} ;done
eval export ${VAR}=${VAL}
}
safe_append_path() {
VAR=$1 ; shift ; eval VAL=\$${VAR}
for i_;do [ -d "$i_" ] && VAL=${VAL:+"$VAL:"}$i_ ;done
eval export ${VAR}=${VAL}
}
Sep
1
2012
[lang_en]
If you are like me, you have regular conference calls where you have to send some bridge identification number or profile to sign in.
On a Nokia N9 it’s really not obvious how to set up a contact that automatically sends those digits after the call is connected, especially if you use the Swype virtual keyboard.
The first thing to know is that in order to specify a pause separation for the digits you need to enter a ‘p’. To me this was a surprise, as I was used to other cellphones which used the comma (‘,’), semi-colon (‘;’) or period (‘.’) for the same purpose, sometimes with different pause intervals
[/lang_en][lang_pt]
Pessoas como eu têm conferências telefónicas regulares em que é necessário enviar digitos para entrar ou activar a conferência.
Num Nokia N9 não é nada óbvio como configurar um contacto para enviar esses digitos automaticamente após a chamada ter sido estabelecida, particularmente se usar o teclado virtual Swype.
A primeira coisa a saber é que para indicar uma pausa no N9 para os digitos é necessário entrar um ‘p’. Para mim isto foi uma surpresa, porque estava habituado a outros telemóveis em que usava a virgula (‘,’), ponto e virgula (‘;’) ou ponto final para isso.
[/lang_pt][lang_en]
If you have swype, when you enter a phone number here is what the screen looks like the image below, a numeric pad virtual keyboard. You disregard the currency symbols and try to enter either the comma or the period and they don’t work.
What you need to do is to tap the bottom ABC button so that it switches to the main alphanumeric virtual keyboard and then you can enter the ‘p’.
[/lang_en][lang_pt]
Se está a usar Swype, quando vai entrar um número de telefone, verá algo como a imagem abaixo, um teclado numérico virtual. Primeiro ignora os simbolos monetarios e tenta digitar a virgula ou o ponto, mas não funciona.
O que precisa fazer é usar o botão ABC do fundo, para mudar para o teclado alfanumerico principal e finalmente pode digitar o ‘p’
[/lang_pt]
![]() |
![]() |
[lang_en]
You have the stock virtual keyboard things are a little simpler, you tap the ‘‘ and notice how it becomes red underlined, tap again and it becomes a ‘+’ and again… the ‘p’ finally. The three taps have to be in quick succession.
[/lang_en][lang_pt]
Se tem o teclado virtual original isto é um pouco mais simples. Basta premir o ‘‘ e note que fica sublinhado a vermelho, prima de novo e fica um ‘+’ e de novo… e finalmente o ‘p’ aparece. Tem que premir as três vezes em rápida sucessão.
[/lang_pt]
![]() |
![]() |
![]() |
![]() |
You must be logged in to post a comment.