Skip to content

Instantly share code, notes, and snippets.

View pavlospt's full-sized avatar
💻
Refactoring something somewhere

Pavlos-Petros Tournaris pavlospt

💻
Refactoring something somewhere
View GitHub Profile
@dlew
dlew / script.sh
Created November 9, 2018 16:36
Simple AndroidX Migration Script
#!/usr/bin/env bash
# I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very
# well, so I wrote my own script to do the simple job of converting package names.
#
# You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv
#
# It'll run faster on a clean build because then there are fewer files to scan over.
#
# Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`.
@florina-muntenescu
florina-muntenescu / BaseDao.kt
Last active September 28, 2023 15:01
Use Dao inheritance to reduce the amount of boilerplate code - https://medium.com/google-developers/7-pro-tips-for-room-fbadea4bfbd1
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@charbgr
charbgr / ErrorHandlerExtensions.kt
Last active October 27, 2016 15:10
ErrorHandler Kotlin Extension
/**
* Creates a new instance of [ErrorHandler]
* Passing a lambda is optional
*/
fun Throwable.handleIsolated(func: ErrorHandler.() -> Unit = {}) {
val errorHandler = ErrorHandler.createIsolated()
func(errorHandler)
errorHandler.handle(this)
}
@charbgr
charbgr / record-gif.sh
Last active October 26, 2016 13:52
Android - Gif Recording Device
#!/bin/bash
adb shell screenrecord --bit-rate=20M "/sdcard/recording.mp4" &
PID=$!
echo "Recording.. ($PID)"
read -n1 -r -p "Press any key to stop" key
kill -SIGHUP $PID
sleep 1
adb pull "/sdcard/recording.mp4"
echo "Gififying..."
gifify -r 60 "recording.mp4"
@chris95x8
chris95x8 / build.gradle
Created October 28, 2014 14:00
Extended toolbar with two floating-label edit texts. The layout was made according to this image from the Material Design guidelines: http://i.imgur.com/x8QsuxU.png The layout below looks like this: http://i.imgur.com/8sOTv7h.png
dependencies {
compile 'com.android.support:appcompat-v7:21.+'
compile 'com.wrapp.floatlabelededittext:library:0.0.5'
}