Skip to content

Instantly share code, notes, and snippets.

View javiromero's full-sized avatar
💭
I may be slow to respond.

Javier Romero javiromero

💭
I may be slow to respond.
View GitHub Profile
@javiromero
javiromero / git_post_checkout_clean_pyc_and_empty_dirs.py
Last active August 8, 2017 22:20
Python scripts to check for new/missing Django migrations and Cleaning *.pyc and *. pyo for deleted *.py files from a repo & to remove any empty dir after every checkout
#!/bin/env python
"""
A hook to git that removes orphan files "*.pyc" and "*.pyo" for "*.py"
beeing deleted or renamed by git checkout. It also removes their empty parent
directories.
Place it to "my_local_repository/.git/hooks/post-checkout" and make it executable.
Nothing is cleaned for .py files deleted manually or by "git rm" etc.
Related to http://stackoverflow.com/q/1504724/448474
"""
import glob
@javiromero
javiromero / .bashrc
Created October 6, 2016 16:52
Bash config
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
@javiromero
javiromero / show_primitive_types.py
Created June 14, 2017 18:18
Recursively explore an instance and print its component's types
def show_primitive_types(instance, depth=0):
"""
Recursively explore an instance and print its components' types.
"""
try:
for attr in vars(instance):
print('\t' * depth, attr, type(getattr(instance, attr)))
show_primitive_types(getattr(instance, attr), depth+1)
except TypeError:
pass
@javiromero
javiromero / android-backup-apk-and-datas.md
Created September 11, 2021 17:41 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Fetch application APK

To get the list of your installed applications:

@javiromero
javiromero / plasma-org.kde.plasma.desktop-appletsrc
Created January 26, 2022 09:27
KDE 5 Plasma "command output" widget PV configs
## Configuration stored in ~/.config/plasma-org.kde.plasma.desktop-appletsrc
## requires curl and jq available in the system
[Containments][2][Applets][68]
immutability=1
plugin=com.github.zren.commandoutput
[Containments][2][Applets][68][Configuration]
PreloadWeight=42