Skip to content

Instantly share code, notes, and snippets.

View berkedel's full-sized avatar

Akhmad Syaikhul Hadi berkedel

View GitHub Profile
@berkedel
berkedel / android-backup-apk-and-datas.md
Created July 8, 2021 01:54 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Fetch application APK

To get the list of your installed applications:

@berkedel
berkedel / MainApplication.java
Created August 18, 2019 03:45 — forked from axemclion/MainApplication.java
Adding Flipper to ReactNative
// Call this in MainApplication.onCreate(), just after Soloader line.
private static void initialize(Context context) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
@berkedel
berkedel / README.md
Created March 12, 2019 06:41 — forked from balupton/README.md
Remove script for Gmail that delets all email threads/messages that match search for when Gmail can't do it itself

Remove script for Gmail

function Intialize() {
  return;
}

function Install() {
  ScriptApp.newTrigger("purgeGmail")
 .timeBased().everyMinutes(10).create();
@berkedel
berkedel / AdbCommands
Created February 25, 2019 10:26 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@berkedel
berkedel / psql_useful_stat_queries.sql
Created December 12, 2018 14:06 — forked from anvk/psql_useful_stat_queries.sql
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@berkedel
berkedel / CustomAuthorizer.java
Created August 6, 2018 14:46 — forked from akeemphilbert/CustomAuthorizer.java
Example of using a Custom Authorizer with Couchbase Lite in Java
package com.domain.example
import com.couchbase.lite.Database;
import com.couchbase.lite.auth.Authorizer;
import com.couchbase.lite.util.Log;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@berkedel
berkedel / error-report.js
Created May 31, 2018 09:28 — forked from tianjianchn/error-report.js
Error report util with fabric/crashlytics in react-native
/*global __DEV__*/
import StackTrace from 'stacktrace-js';
const Fabric = require('react-native-fabric');
const { Crashlytics } = Fabric;
//call this to start capturing any no-handled errors
exports.init = function(captrueOnDebugMode){
if (__DEV__ && !captrueOnDebugMode) {
return;
@berkedel
berkedel / postgres-cheatsheet.md
Created May 1, 2018 00:03 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@berkedel
berkedel / adding_new_webhook_topics.php
Created February 3, 2018 07:38 — forked from jessepearson/adding_new_webhook_topics.php
How to add a new custom Webhook topic in WooCommerce, with example of order filtering.
<?php // do not copy this line
/**
* add_new_topic_hooks will add a new webhook topic hook.
* @param array $topic_hooks Esxisting topic hooks.
*/
function add_new_topic_hooks( $topic_hooks ) {
// Array that has the topic as resource.event with arrays of actions that call that topic.