Skip to content

Instantly share code, notes, and snippets.

:octocat:
Coding & Learning 🎓

Romell D.Z. romellfudi

:octocat:
Coding & Learning 🎓
Block or report user

Report or block romellfudi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@romellfudi
romellfudi / open_app.sh
Last active Jul 29, 2019
Android, device, abd, shell
View open_app.sh
// list all package
adb shell pm list packages
// find a package by name
adb shell "pm list packages -f sidesync"
ex:
adb shell monkey -p com.sec.android.sidesync30 -v 500
View generate_ssh.sh
cat ~/.ssh/id_rsa.pub
cat ~/.ssh/id_rsa.pub | pbcopy
View Permissions.md

This popup is caused by the manifest.PERMISSION.SYSTEM_ALERT_WINDOW permission declared by the manifest. The are 3 categories of permissions, that developer must be aware of.:

  1. Normal permission - do nothing with them, just declare in the Manifest
  2. Vulnerable permissions - declare in Manifest and ask for permission at first time. They can be changed through system settings
  3. Above dangerous permissions: SYSTEM_ALERT_WINDOW and WRITE_SETTINGS belong to this category. They must be granted, but are not visible in system settings. To request for it you don't use a standard way (int checkSelfPermission (String permission)) but you have to
@romellfudi
romellfudi / index.html
Last active Jun 30, 2019
WebAPK APP MANIFEST CHROME HOME SCREEN
View index.html
...
<link rel="manifest" href="/manifest.json">
</head>
...
<script>
@romellfudi
romellfudi / android.buttom.java
Last active Mar 23, 2019
Prevent Double clicks on buttom
View android.buttom.java
public class OnClickRate implements View.OnClickListener {
private final static int CLICK_DELAY_DEFAULT = 300;
private View.OnClickListener onClickListener;
private int mClickDelay;
public OnClickRateLimitedDecoratedListener(View.OnClickListener onClickListener) {
this(onClickListener, CLICK_DELAY_DEFAULT);
}
@romellfudi
romellfudi / jupyter.simple.py
Last active Jan 22, 2019
simple init code from data science workspace
View jupyter.simple.py
import warnings
warnings.filterwarnings(action='once')
warnings.simplefilter('ignore' )
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (18,6)
from IPython.display import clear_output
import numpy as np
@romellfudi
romellfudi / 4_classifiers.py
Created Jan 14, 2019
print 4 plots using grid area
View 4_classifiers.py
def make_meshgrid(x, y, h=.02):
x_min, x_max = x.min() - 1, x.max() + 1
y_min, y_max = y.min() - 1, y.max() + 1
xx, yy = np.meshgrid(np.arange(x_min, x_max, h),
np.arange(y_min, y_max, h))
return xx, yy
def plot_contours(ax, clf, xx, yy, **params):
Z = clf.predict(np.c_[xx.ravel(), yy.ravel()])
View copy_structure.sh
rsync -a --include '*/' --include '*.html' --include '*.png' --exclude '*'
@romellfudi
romellfudi / productFlavors.gradle3.3.gradle
Created Dec 26, 2018
flavors at android 3 with gradle 3.3
View productFlavors.gradle3.3.gradle
flavorDimensions "dimension"
productFlavors{
pro{
dimension "dimension"
applicationIdSuffix ".demo"
versionNameSuffix "-demo"
}
dev{
dimension "dimension"
applicationIdSuffix ".full"
@romellfudi
romellfudi / android_avd.sh
Last active Dec 17, 2018
avd, android, emulator
View android_avd.sh
cd ~/Library/Android/sdk/tools/bin && ./avdmanager list avd
cd ~/Library/Android/Sdk/tools && ./emulator -avd Nexus_5X_API_26
You can’t perform that action at this time.