Skip to content

Instantly share code, notes, and snippets.

@frestoinc
frestoinc / CC.md
Created September 10, 2024 05:02 — forked from mvandermeulen/CC.md
(ISC)2 Flashcards for CC (Certified in Cybersecurity)
  1. Security commensurate with the risk and the magnitude of harm resulting from the loss, misuse or unauthorized access to or modification of information.

Adequate Security

  1. Controls implemented through policy and procedures. Examples include access control processes and requiring multiple personnel to conduct a specific operation. Administrative controls in modern environments are often enforced in conjunction with physical and/or technical controls, such as an access-granting policy for new users that requires login and approval by the hiring manager.

Administrative Controls

  1. The ability of computers and robots to simulate human intelligence and behavior. > Artificial Intelligence
@frestoinc
frestoinc / PermissionActivity.md
Created April 2, 2021 18:08 — forked from mmoczkowski/PermissionActivity.md
Async permissions with Kotlin coroutines
package io.stanwood.bitrise

import android.annotation.SuppressLint
import android.content.pm.PackageManager
import android.support.v4.app.ActivityCompat
import android.support.v4.content.ContextCompat
import android.support.v7.app.AppCompatActivity
import kotlinx.coroutines.experimental.CancellableContinuation
import kotlinx.coroutines.experimental.suspendCancellableCoroutine
@frestoinc
frestoinc / ConfigGson.kt
Created October 27, 2020 09:13 — forked from vorobeij/ConfigGson.kt
Gson interface adapter for "Register an InstanceCreator with Gson for this type may fix this problem"
object ConfigGson {
fun getGson() = GsonBuilder().apply {
registerTypeAdapter(Launchable::class.java, InterfaceAdapter<Launchable>())
registerTypeAdapter(Trigger::class.java, InterfaceAdapter<Trigger>())
}.create()
}
@frestoinc
frestoinc / SharedPreferencesSingletonEnumKeyTemplate.java
Created September 14, 2020 01:26 — forked from alphamu/SharedPreferencesSingletonEnumKeyTemplate.java
A SharedPreferences singleton that can be used to centralise and simplify reading and writing of SharedPerferences in your Android app. There are 2 versions, one that uses static String for Keys and an other that uses enums. Which one you use comes down to your preference, enums I feel provides better control when you have multiple programmers w…
#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.content.Context;
import android.content.SharedPreferences;
/*
* A Singleton for managing your SharedPreferences.
*
* You should make sure to change the SETTINGS_NAME to what you want
* and choose the operating made that suits your needs, the default is
@frestoinc
frestoinc / AdbCommands
Created August 11, 2020 05:27 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
<service
android:name="com.example.AuthenticatorService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
@frestoinc
frestoinc / AndroidManifest.xml
Created February 28, 2019 04:48 — forked from JosiasSena/AndroidManifest.xml
Sync Adapter example
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.packagename">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<application
public class PhoneBookManager {
private final ContentResolver contentResolver;
public PhoneBookManager(final Context context) {
contentResolver = context.getContentResolver();
}
private boolean isContactWithNumberExists(@NonNull final String number) {
@frestoinc
frestoinc / DeCryptor.java
Created February 28, 2019 04:43 — forked from JosiasSena/DeCryptor.java
Encryptor and Decryptor for data encryption.decryption using the Android KeyStore.
/**
_____ _____ _
| __ \ / ____| | |
| | | | ___| | _ __ _ _ _ __ | |_ ___ _ __
| | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__|
| |__| | __/ |____| | | |_| | |_) | || (_) | |
|_____/ \___|\_____|_| \__, | .__/ \__\___/|_|
__/ | |
|___/|_|
*/