Skip to content

Instantly share code, notes, and snippets.

@albertogarrido
albertogarrido / git_branch_status_prompt.sh
Created September 23, 2015 18:27
Show git branches on terminal prompt. With branch status in color, time and current directory.
## SOURCE & CREDIT: http://mediadoneright.com/content/ultimate-git-ps1-bash-prompt
## lines 9 & 10 fix for mac os x found in SO
## customizations: 24h time and change colors :)
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
source /usr/local/git/contrib/completion/git-completion.bash
source /usr/local/git/contrib/completion/git-prompt.sh
@albertogarrido
albertogarrido / android_studio_shortcuts.md
Created March 30, 2017 09:02 — forked from stkent/android_studio_shortcuts.md
Android Studio Shortcuts (Mac)

Android Studio Shortcuts (Mac)

Notes:

  • Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
  • Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
  • A fairly complete shortcut list can be found here.

Useful symbols:

// in chrome console
// if many diffs will be slow :P
var clickAction = function(element) { element.click(); }
var elementsExpand = document.getElementsByClassName('load-diff-button');
Array.prototype.forEach.call(elementsExpand, clickAction);
var elementsCollapse = document.getElementsByClassName('btn-octicon');
Array.prototype.forEach.call(elementsCollapse, clickAction);
@albertogarrido
albertogarrido / i3-gaps.sh
Created August 21, 2018 13:24 — forked from dabroder/i3-gaps.sh
Install i3-gaps on ubuntu 18.04
#!/bin/bash
sudo apt install -y libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf libxcb-xrm0 libxcb-xrm-dev automake
cd /tmp
# clone the repository
git clone https://www.github.com/Airblader/i3 i3-gaps
cd i3-gaps
# compile & install
#!/bin/bash
HDMI=$(xrandr | grep " connected " | grep "HDMI-0")
THUNDER=$(xrandr | grep " connected " | grep "^DP-1")
INTERNAL=$(xrandr | grep " connected " | grep "eDP-1")
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
while pgrep -x polybar >/dev/null; do sleep 1; done
@albertogarrido
albertogarrido / languages_wiki.js
Last active November 26, 2018 10:41
Get Languages from wikipedia, format as json
(function() {
var arrayResult =[]
var arrayOfHeaders = []
$('table.sortable th').each(function(index) {
var value = $(this).text().trim()
if(value.length === 0) {
@albertogarrido
albertogarrido / ViewExtensions.kt
Created February 1, 2019 10:42
Android view visibility extension functions
import android.view.View
fun View.visible() {
visibility = View.VISIBLE
}
fun View.invisible() {
visibility = View.INVISIBLE
}

Keybase proof

I hereby claim:

  • I am albertogarrido on github.

  • I am albertogarrido (https://keybase.io/albertogarrido) on keybase.

  • I have a public key ASDKkP3JVR6_E-wVQJ2U4NdTFV_BheYjbwGteYdhcHeOeQo

@albertogarrido
albertogarrido / things-i-believe.md
Created February 29, 2020 19:55 — forked from stettix/things-i-believe.md
Things I believe

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette. See also my blog at www.janvsmachine.net.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = red reverse
local = blue
remote = green