Skip to content

Instantly share code, notes, and snippets.

View felipeska's full-sized avatar
🏠
Working from home

Felipe felipeska

🏠
Working from home
View GitHub Profile
@pitfield
pitfield / Create an iOS app with Swift Package Manager dependencies.md
Last active July 18, 2023 01:34
Create an iOS app with Swift Package Manager dependencies

Create an iOS app with Swift Package Manager dependencies

CAUTION: This information is mostly obsolete. Xcode 11 allows a project to directly declare its Swift Package Manager dependencies.

This gist walks through creating an Xcode project for an iOS app that consumes packages in Swift Package Manager (SPM).

We'll be using Xcode 10.2 and Swift 5.

Scenario

@Diederikjh
Diederikjh / Cryptography.java
Last active February 23, 2024 10:07
Single class that handles encryption and decryption with keys using the Android `Keystore` API. Mostly inspired by this [blog post](https://medium.com/@ericfu/securely-storing-secrets-in-an-android-application-501f030ae5a3). This was tested with API 18 and 25 level emulator (and a level 23 device).
package com.example.yourapp;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.security.KeyPairGeneratorSpec;
import android.security.keystore.KeyGenParameterSpec;
import android.security.keystore.KeyProperties;
import android.support.annotation.RequiresApi;
@intrepid-ab
intrepid-ab / proguard-project.txt
Created June 8, 2016 18:27
Proguard Configuration for Android Library
# Save the obfuscation mapping to a file, so we can de-obfuscate any stack
# traces later on. Keep a fixed source file attribute and all line number
# tables to get line numbers in the stack traces.
# You can comment this out if you're not interested in stack traces.
-printmapping out.map
-keepparameternames
-renamesourcefileattribute SourceFile
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,
SourceFile,LineNumberTable,EnclosingMethod
@JonDouglas
JonDouglas / xamarinandroidbindings.md
Last active March 12, 2024 10:36
Xamarin Android Bindings Troubleshooting

Approaching a Xamarin.Android Bindings Case

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Binding is to first ensure you have the proper tooling available:

@paragonie-scott
paragonie-scott / crypto-wrong-answers.md
Last active April 21, 2024 23:48
An Open Letter to Developers Everywhere (About Cryptography)
@mttkay
mttkay / Pager.java
Created November 4, 2015 15:46
A simple Rx based pager
public class Pager<I, O> {
private static final Observable FINISH_SEQUENCE = Observable.never();
private PublishSubject<Observable<I>> pages;
private Observable<I> nextPage = finish();
private Subscription subscription = Subscriptions.empty();
private final PagingFunction<I> pagingFunction;
private final Func1<I, O> pageTransformer;
@vvkirillov
vvkirillov / BitmapUtils.java
Created October 21, 2015 12:53
Android bitmap conversion to and from byte array
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.util.Log;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
@chemouna
chemouna / RecyclerViewAssertions.java
Last active November 19, 2021 07:16
Some assertions to help with testing recyclerview with espresso.
import android.support.test.espresso.NoMatchingViewException;
import android.support.test.espresso.ViewAssertion;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.google.common.truth.Truth;
import java.util.ArrayList;
import org.hamcrest.Matcher;
import org.junit.Assert;
@mannodermaus
mannodermaus / LoganSquareConverter.java
Last active September 16, 2021 12:28
LoganSquare Retrofit Converter
package retrofit.converter;
import com.bluelinelabs.logansquare.LoganSquare;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;
import retrofit.converter.ConversionException;
import retrofit.converter.Converter;
@eveliotc
eveliotc / android-select-device
Last active February 5, 2019 06:10
My (android) dev aliases and scripts
#! /bin/bash
# from http://dtmilano.blogspot.com/2012/03/selecting-adb-device.html
# selects an android device
PROGNAME=$(basename $0)
UNAME=$(uname)
DEVICE_OPT=
for opt in "$@"
do
case "$opt" in