Skip to content

Instantly share code, notes, and snippets.

View javmarina's full-sized avatar

Javi Marina javmarina

View GitHub Profile
javmarina /
Last active September 22, 2020 15:25
AndroidStringsXmlPrettifier: use the same structure and order as values/strings.xml for all the translations.
import os
import platform
import xml.etree.ElementTree as ET
class CommentedTreeBuilder(ET.TreeBuilder):
def comment(self, data):
self.start(ET.Comment, {})
javmarina /
Last active September 22, 2020 15:50
Google Photos date sorter
import os, shutil, sys
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
from googleapiclient.http import MediaIoBaseUpload
from requests import get, post
from io import BytesIO
javmarina /
Last active May 14, 2021 07:56
Firebase Realtime Database automatic listener handler (removes ValueEventListener from DatabaseReference when no longer needed)
// Make all activities in your app extend BaseActivity
public class BaseActivity extends AppCompatActivity {
private FirebaseListenerHandler firebaseListenerHandler;
protected void onCreate(final Bundle savedInstanceState) {
firebaseListenerHandler = new FirebaseListenerHandler(this);