Skip to content

Instantly share code, notes, and snippets.

@munho
munho / AndroidRsaCipherHelper.kt
Created January 10, 2019 08:19 — forked from FrancescoJo/AndroidRsaCipherHelper.kt
Android RSA cipher helper with system generated key. No more static final String key in our class - an approach which is very vulnerable to reverse engineering attack.
import android.os.Build
import android.security.KeyPairGeneratorSpec
import android.security.keystore.KeyGenParameterSpec
import android.security.keystore.KeyProperties
import android.util.Base64
import timber.log.Timber
import java.math.BigInteger
import java.security.GeneralSecurityException
import java.security.KeyPairGenerator
import java.security.KeyStore
@munho
munho / SecureSharedPreferences.kt
Created January 10, 2019 08:20 — forked from FrancescoJo/SecureSharedPreferences.kt
A SharedPreferences wrapper implementation with encryption/decryption, using CipherHelper implementation.
import android.content.SharedPreferences
/**
* A [android.content.SharedPreferences] wrapper that helps easy reading/writing values.
*
* @author Francesco Jo(nimbusob@gmail.com)
* @since 22 - Mar - 2018
*/
class SecureSharedPreferences(private val sharedPref: SharedPreferences) {
fun contains(key: String) = sharedPref.contains(key)
@munho
munho / pi_thunderboard.md
Last active April 12, 2019 04:37 — forked from hornej/pi_thunderboard.mdown
Raspberry Pi and Thunderboard help

Thunderboard Setup

I had a very difficult time following this tutorial so I am writing this to help me and other people. I would recommend following the directions in the tutorial using this page for reference if things go wrong.

I did this whole process on my Raspberry Pi 3 with Raspbian OS.

Following the GitHub doc

First things first: clone the repository.

git clone https://github.com/SiliconLabs/thundercloud.git

@munho
munho / BBBautostartGUI.md
Created August 14, 2019 04:25
BBB Autostart a GUI
@munho
munho / sub_qt.py
Created August 21, 2019 04:20 — forked from blubberdiblub/sub_qt.py
Minimal console output of a subprocess with PyQt.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtCore import pyqtSignal, pyqtSlot, QProcess, QTextCodec
from PyQt5.QtGui import QTextCursor
from PyQt5.QtWidgets import QApplication, QPlainTextEdit
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Created by mladenrakonjac on 01/06/16.
*/
public class ServiceGenerator {
@munho
munho / ServiceGenerator.java
Created October 24, 2019 01:07 — forked from sjarifHD/ServiceGenerator.java
Retrofit2 Service Generator
public class ServiceGenerator {
private static final String API_BASE_URL = "https://api.github.com/";
private static Retrofit retrofit;
private static Gson mGson = new GsonBuilder()
.setDateFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'SSS'Z'")
.create();
@munho
munho / FragmentArgumentDelegate.kt
Created March 3, 2020 23:13 — forked from yanngx/FragmentArgumentDelegate.kt
Fragment arguments without hassle !
package be.brol
import android.os.Binder
import android.os.Bundle
import android.support.v4.app.BundleCompat
import android.support.v4.app.Fragment
/**
* Eases the Fragment.newInstance ceremony by marking the fragment's args with this delegate
* Just write the property in newInstance and read it like any other property after the fragment has been created
@munho
munho / left_fn.json
Created June 3, 2020 23:55
Home, End, Page Up, Page Down keys for Logitech K380 (with Logitech Options uninstalled for fn and installed for option)
{
"title": "Home, End, Page Up, Page Down keys for Logitech K380 (with Logitech Options uninstalled)",
"rules": [
{
"description": "Change left arrow + fn to home",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_arrow",
@munho
munho / ViewController.swift
Created September 24, 2020 03:54 — forked from iamchiwon/ViewController.swift
[코드리뷰쇼] #1. Relay 5개라굽쇼?
import RxCocoa
import RxSwift
import UIKit
class ViewController: UIViewController {
enum SortType {
case none, newest, oldest
}
enum MonthType {