Skip to content

Instantly share code, notes, and snippets.

@sagix
sagix / MutableDecoratorExtensions.kt
Created October 24, 2018 08:01
Mutable decorator with lifecyle extensions
@file:JvmName("MutableDecoratorUtils")
package net.ilius.android.core.android
import android.arch.lifecycle.Lifecycle
import android.arch.lifecycle.LifecycleObserver
import android.arch.lifecycle.LifecycleOwner
import android.arch.lifecycle.OnLifecycleEvent
import com.nicolasmouchel.executordecorator.MutableDecorator
@chrisbanes
chrisbanes / CoroutineLifecycleObserver.kt
Last active September 9, 2022 14:07
LifecycleObserver which allows easy cancelling of coroutines
/*
* Copyright 2018 Google LLC
*
* 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
@cbeyls
cbeyls / KotlinFunctions.md
Last active August 12, 2024 07:36
Comparison of Kotlin functions: also, apply, let, run, with
Function Function type Target passed as Returns
also Extension it Target
apply Extension this Target
let Extension it Block return value
run Extension this Block return value
with Regular this Block return value
@jinqian
jinqian / release.gradle
Created February 14, 2017 21:47
Gradle Script for auto version incrementing, git tagging, and deploying to Beta by Crashlytics
/*
* Copyright © 52inc 2015.
* All rights reserved.
*/
apply plugin: 'org.ajoberstar.grgit'
import groovy.json.*
def versionFile = file("../version.json")
@JosiasSena
JosiasSena / DeCryptor.java
Last active September 12, 2023 12:40
Encryptor and Decryptor for data encryption.decryption using the Android KeyStore.
/**
_____ _____ _
| __ \ / ____| | |
| | | | ___| | _ __ _ _ _ __ | |_ ___ _ __
| | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__|
| |__| | __/ |____| | | |_| | |_) | || (_) | |
|_____/ \___|\_____|_| \__, | .__/ \__\___/|_|
__/ | |
|___/|_|
*/
@vadimkantorov
vadimkantorov / rdv_naturalisation.sh
Last active January 16, 2024 20:26
A Bash script to monitor naturalisation rendez-vous availability at Prefectures Bobigny, Nanterre. Consider renting one or several EC2 micro instances at Paris AWS data center to avoid bans.
# Usage:
# 1. Put in your email/SendGrid credentials or phone/Twilio credentials
# 2. Run as: "bash rdv_naturalisation.sh nanterre" or "bash rdv_naturalisation.sh bobigny" or "bash rdv_naturalisation.sh cre"
# 3. Get your RDV! The script will dump the HTML of the page and will continue execution even after the first RDV is found.
SENDGRID_BEARER_TOKEN='' # should start with "SG."
SENDGRID_EMAIL='' # put your e-mail here
TWILIO_SID='' # should start with "AC"
TWILIO_AUTH_TOKEN=''
TWILIO_FROM_NUMBER='' # put your Twilio Trial Phone Number here, should start with +
anonymous
anonymous / XLEDBackpack.py
Created November 13, 2015 20:55
#!/usr/bin/python
import time
from copy import copy
from Adafruit_I2C import Adafruit_I2C
# ============================================================================
# LEDBackpack Class
# ============================================================================
@shekibobo
shekibobo / README.md
Last active March 2, 2020 11:04
Android: Base Styles for Button (not provided by AppCompat)

How to create custom button styles using Android's AppCompat-v7:21

Introduction

AppCompat is an Android support library to provide backwards-compatible functionality for Material design patterns. It currently comes bundled with a set of styles in the Theme.AppCompat and Widget.AppCompat namespaces. However, there is a critical component missing which I would have thought essential to provide the a default from which we could inherit our styles: Widget.AppCompat.Button. Sure, there's Widget.AppCompat.Light.ActionButton, but that doesn't actually inherit from Widget.ActionButton, which does not inherit from Widget.Button, so we might get some unexpected behavior using that as our base button style, mainly because Widget.ActionButton strictly belongs in the ActionBar.

So, if we want to have a decently normal default button style related to AppCompat, we need to make it ourselves. Let's start by digging into the Android SDK to see how it's doing default styles.

Digging In

@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@wbroek
wbroek / genymotionwithplay.txt
Last active November 8, 2024 01:24
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)