Skip to content

Instantly share code, notes, and snippets.

View Alberto97's full-sized avatar

Alberto Pedron Alberto97

View GitHub Profile
#!/usr/bin/env python3
import subprocess
import sys
def get_adb_output(command):
try:
# We remove text=True to get raw bytes
result = subprocess.run(command.split(), capture_output=True, check=True)
# Decode manually, ignoring characters that aren't valid UTF-8
eval "$(/opt/homebrew/bin/brew shellenv)"
source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source $(brew --prefix)/share/zsh-history-substring-search/zsh-history-substring-search.zsh
# bind UP and DOWN arrow keys to history substring search
zmodload zsh/terminfo
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
@Alberto97
Alberto97 / MapFragment.kt
Last active December 23, 2021 17:44
Disable clustering in Google Maps at specified zoom level with android-maps-utils
[...]
// Map Configuration
val clusterManager = ZoomClusterManager<ClusterItem>(requireContext(), googleMap)
clusterManager.renderer = ZoomClusterRenderer(requireContext(), googleMap, clusterManager)
googleMap.setOnCameraIdleListener(clusterManager)
[...]
@Alberto97
Alberto97 / motofw.py
Last active February 18, 2024 02:19
#!/usr/bin/env python3
#
# Generates a fastboot script from RSD provided xml in moto firmwares
#
import xml.etree.ElementTree
from argparse import ArgumentParser
blacklist = ["partition", "bootloader", "modem", "fsg", "modemst1", "modemst2", "dsp", "logo", "DDR"]
From 3803ee10bb8cdf0b5e00ba2a1bb1e2cafdc40051 Mon Sep 17 00:00:00 2001
From: Alberto97 <albertop2197@gmail.com>
Date: Sat, 26 Aug 2017 14:47:12 +0200
Subject: [PATCH] msm8916-common: bt: Remove net_bt_stack
* net_bt_stack is gone, replace it with bluetooth (android/platform_system_core@604208e957ad6fb692c445b0f598579051d2071a)
Change-Id: I62ac0fa2e59a9643fd6a3d4b173dd8c8892037b9
---
rootdir/etc/ueventd.qcom.rc | 4 ++--
@Alberto97
Alberto97 / moto.py
Last active September 7, 2017 20:31
Given the build number, return some firmware infos.
import re
import sys
if (len(sys.argv) > 1):
string = sys.argv[1]
else:
string = "KXA21.12-L1.26"
array = list(string)
array2 = re.split('\W+', string)