Skip to content

Instantly share code, notes, and snippets.

View mirjalal's full-sized avatar
👨‍💻
Composing

Mirjalal mirjalal

👨‍💻
Composing
View GitHub Profile
@mirjalal
mirjalal / multifilepicker.kt
Last active June 28, 2019 12:20 — forked from kingargyle/multifilepicker.java
Android 4.4+ Select Multiple Files with UI File Picker
val intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
startActivityForResult(intent, 1)
// In code that handles the result returned to process the files:
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
@mirjalal
mirjalal / getFilePath.kt
Created July 4, 2019 11:55
Get path of the files which picked from internal/external storage, Google Drive and Google Photos
/**
* Get full file path from external storage
*
* @param pathData The storage type and the relative path
*/
private fun getPathFromExtSD(pathData: Array<String>): String {
val type = pathData[0]
val relativePath = "/" + pathData[1]
var fullPath: String
@mirjalal
mirjalal / The Math of ML.html
Created July 24, 2019 08:35
The Mathematics of Machine Learning by UC Berkeley. Written by Garret Thomas. Confuse to learn Math for Machine Learning, UC Berkeley give very good guidelines about math you need to learn.
<a href="https://media.licdn.com/dms/image/C511FAQHSxF6jLy6d5g/feedshare-document-images_800/1?e=1564041600&amp;v=beta&amp;t=oW9zc4qHy_n_6MmFHoL8sSJwisiPjQDHZVT8odnrmHU">Page 1</a>
<a href="https://media.licdn.com/dms/image/C511FAQHSxF6jLy6d5g/feedshare-document-images_800/2?e=1564041600&amp;v=beta&amp;t=lFF_CS1FBZQh2NAQp5qeZoENbhdfZPjetLVukd2pB0A">Page 2</a>
<a href="https://media.licdn.com/dms/image/C511FAQHSxF6jLy6d5g/feedshare-document-images_800/3?e=1564041600&amp;v=beta&amp;t=R8BzvUX5ngwb3D4f3LBAMLDkQEqsbKYG0-JLiCHYx_I">Page 3</a>
<a href="https://media.licdn.com/dms/image/C511FAQHSxF6jLy6d5g/feedshare-document-images_800/4?e=1564041600&amp;v=beta&amp;t=QK6oT05ZmXBhVAMTfbgrajSC-oYUU_dADgbH3jYBFzM">Page 4</a>
<a href="https://media.licdn.com/dms/image/C511FAQHSxF6jLy6d5g/feedshare-document-images_800/5?e=1564041600&amp;v=beta&amp;t=S7sN6E-Us7LvtYprczVxAxldQ6OfNN2nec7Rj5MCUlk">Page 5</a>
<a href="https://media.licdn.com/dms/image/C511FAQHSxF6jLy6d5g/feedshare-document-images_800/6?e=1564041600&amp;v=beta&
@mirjalal
mirjalal / android-wait-for-emulator
Created January 8, 2020 08:48
The copy of the original one (never will be deleted!)
#!/bin/bash
# Originally written by Ralf Kistner <[email protected]>, but placed in the public domain
set +e
bootanim=""
failcounter=0
timeout_in_sec=360
@mirjalal
mirjalal / disable_realtime_protection.reg
Created December 15, 2020 09:16
save the code below to disable_realtime_protection.reg and run to disable windows defender completely!
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender]
"DisableAntiSpyware"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection]
"DisableBehaviorMonitoring"=dword:00000001
"DisableOnAccessProtection"=dword:00000001
"DisableScanOnRealtimeEnable"=dword:00000001
#!/usr/bin/env python
from sys import argv, exit, stdout
from time import sleep, time
from os import system
from subprocess import check_output, CalledProcessError
from threading import Thread, Event
from functools import partial
class StoppableThread(Thread):
601085b94cd77f0b54ff86406957099ebe79c4d6
859f317696f67ef3d7f30a50a5560e7834b43903
24333f8a63b6825ea9c5514f83c2829b004d1fee
84831b9409646a918e30573bab4c9c91346d8abd