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 / Linu_Commands.md
Last active October 21, 2020 19:52
Linux Commands

How to check ram speed and type on Linux or Unix-like system:

sudo dmidecode --type 17

@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 / kannel.conf
Created November 18, 2017 14:12
Kannel configurations for sending fake sms
group = core
admin-port = 13000
admin-password = test
admin-deny-ip = "*.*.*.*"
admin-allow-ip = "127.0.0.1"
smsbox-port = 13001
box-deny-ip = "*.*.*.*"
box-allow-ip = "127.0.0.1"
dlr-storage = internal
log-level = 0
@Antarix
Antarix / FirebaseDataReceiver.java
Created November 21, 2016 10:22
Firebase Android Sample for managing notification
import android.content.Context;
import android.content.Intent;
import android.support.v4.content.WakefulBroadcastReceiver;
import android.util.Log;
/**
* This is called whenever app receives notification
* in background/foreground state so you can
* apply logic for background task, but still Firebase notification
* will be shown in notification tray
@Antarix
Antarix / config.php
Last active October 20, 2020 11:46
Php CRUD API Sample
<?php
define('DB_HOST', 'localhost');
define('DB_USER', 'YOUR_USER');
define('DB_PASSWORD', 'YOUR_PASSWORD');
define('DB_DATABASE', 'YOUR_DB');
define('ANDROID_API','YOUR API TOKEN');
@Antarix
Antarix / GetSample.html
Created August 31, 2016 06:41
Get json test html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){