Skip to content

Instantly share code, notes, and snippets.

View Antarix's full-sized avatar

Antarix Antarix

View GitHub Profile
@Antarix
Antarix / two_line_item_layout.xml
Created July 7, 2020 17:03 — forked from renanferrari/two_line_item_layout.xml
Android Material Design List Item Layouts (based on http://stackoverflow.com/a/27661786/518179)
<!-- Clickable and selectableItemBackground are optional -->
<RelativeLayout
android:id="@+id/two_line_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:clickable="true"
android:minHeight="72dp"
android:paddingEnd="?listPreferredItemPaddingRight"
android:paddingLeft="?listPreferredItemPaddingLeft"
@Antarix
Antarix / gitflow-breakdown.md
Created January 16, 2019 07:32 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@Antarix
Antarix / Howto convert a PFX to a seperate .key & .crt file
Created July 13, 2018 15:10 — forked from TemporaryJam/Howto convert a PFX to a seperate .key & .crt file
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]`
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.
Now let’s extract the certificate:
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]`
@Antarix
Antarix / MainApplication.java
Last active December 19, 2017 13:04 — forked from patrickhammond/gist:0b13ec35160af758d98c
Sample for how to use the Google Play Services dynamic security provider to keep the SSL library that the app will use to up date.
package com.mycompany.myapp.app;
import android.app.Application;
import android.content.Intent;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.security.ProviderInstaller;
import com.google.android.gms.security.ProviderInstaller.ProviderInstallListener;
public class MainApplication extends Application {

Here is a guide on how to get running a minimal project using emqttc.

  1. Install rebar3 (https://www.rebar3.org). You may look for it in your distribution or just install it from the website.
  2. Create a project. We will create a library project, which is good for experimenting. Later, when you want to build an actual application, you should create an app project or a release project.
$ rebar3 new lib emqtcc_minimal_project

This will create a directory emqtcc_minimal_project in your CWD with project structure in it.

@Antarix
Antarix / git-feature-workflow.md
Created March 29, 2016 06:35 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow

There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.

The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.

When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].

Basic branching

When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.

@Antarix
Antarix / SearchableAdapter.java
Created February 26, 2016 07:42 — forked from fjfish/SearchableAdapter.java
Simple String Adapter for Android ListView that has a filter that gives whatever it finds and ignores word boundaries
package com.yourco.yourapp;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
@Antarix
Antarix / LagTracker.java
Created October 20, 2015 06:25
A simple class that can track how long code takes to execute.
import android.util.Log;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* @author Aidan Follestad (afollestad)
*/
public class LagTracker {
@Antarix
Antarix / Android Studio .gitignore
Last active November 24, 2016 09:12 — forked from iainconnor/Android Studio .gitignore
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
@Antarix
Antarix / AnimatedActivity.java
Last active November 24, 2016 09:13 — forked from kwent/AnimatedActivity.java
Activity transition animations like the Vine Android application. - See more at: http://blog.quent.in/index.php/2013/06/activity-transition-animations-like-the-vine-android-application/
public class AnimatedActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
//opening transition animations
overridePendingTransition(R.anim.activity_open_translate,R.anim.activity_close_scale);
}