Skip to content

Instantly share code, notes, and snippets.

@nicolasjafelle
nicolasjafelle / RxEventBus.java
Last active May 28, 2018 23:16
Event Bus implementation with RxJava. It also post all event in the UI Thread.
import android.os.Handler;
import android.os.Looper;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import rx.Subscription;
import rx.functions.Action1;
import rx.functions.Func1;
import rx.internal.util.SubscriptionList;
@NikolaDespotoski
NikolaDespotoski / BottomNavigationBehavior.java
Last active December 19, 2022 06:14
Bottom Navigation behavior
/*
* BottomNavigationLayout library for Android
* Copyright (c) 2016. Nikola Despotoski (http://github.com/NikolaDespotoski).
* 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
@chrisbanes
chrisbanes / CollapsingTitleLayout.java
Last active March 26, 2023 11:58
CollapsingTitleLayout
/*
* Copyright 2014 Chris Banes
*
* 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
@misterwell
misterwell / CreateP12PushCert.sh
Last active March 3, 2024 18:42
A shell script for creating a .p12 certificate file containing the Certificate & private key for use by an APNS push provider application
#!/bin/sh
# Script for generating .p12 files from APNS .cer files.
# Instructions:
# 1. Generate & download the push certificate inside Apple's developer portal
# 2. Import the .cer file into your Mac's Keychain Access, find it in your certificate list, and expand it to show the paired private key.
# 3. Select both the certificate and the paired private key, CTRL-Click & select Export Keys. Save it as Certificates.p12 in the same folder as the downloaded .cer file. You may give it a passphrase if you'd like, but be sure to remember it if you do.
# 4. Execute this shell file, with the format './CreateP12PushCert.sh <DownloadedCerFilename> <ExportedP12Filename> <OutputP12Filename>'
usage ()
{
@rafali
rafali / ResizeAnimation.java
Last active February 26, 2021 13:05
Resize animation on Android
public class ResizeAnimation extends Animation {
final int startWidth;
final int targetWidth;
View view;
public ResizeAnimation(View view, int targetWidth) {
this.view = view;
this.targetWidth = targetWidth;
startWidth = view.getWidth();
}