Skip to content

Instantly share code, notes, and snippets.

@albertogarrido
albertogarrido / CheckUnusedStringsAndroid.kt
Last active March 6, 2024 10:54
Check unused strings android
/**
Small utility to find all unused strings on an android project
Build:
$ kotlinc CheckUnusedStringsAndroid.kt -include-runtime -d CheckUnusedStringsAndroid.jar
Run:
$ java -jar CheckUnusedStringsAndroid.jar $PATH_TO_YOUR_PROJECT
*/
@albertogarrido
albertogarrido / HyperlinkText.kt
Last active March 28, 2023 15:04 — forked from stevdza-san/HyperlinkText.kt
Embedd a Hyperlink within a Text using Jetpack Compose.
import androidx.compose.foundation.text.ClickableText
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.TextUnit
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = red reverse
local = blue
remote = green
@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.

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 / 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
}
@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) {
#!/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 / 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
// 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);