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 / zip_file.py
Created Sep 27, 2019
zip python colab file files
View zip_file.py
name_zip ='name.zip'
list_f = !ls patterns -lt # order by date modificate
!zip {name_zip} ' '.join({list_f})
@romellfudi
romellfudi / pascal.voc_xml.py
Last active Sep 14, 2019
Change Pascal annots resize box
View pascal.voc_xml.py
import os
import re
import glob
import math
dir_ = 'annots/'
output = 'annots/'
width = 512
height = width
extension = 'xml'
@romellfudi
romellfudi / resize.image.py
Last active Sep 13, 2019
OpenCV Resize image
View resize.image.py
import cv2
import os
dir_ = 'images/'
output = 'images/'
width = 512
height = width
dim = (width, height)
for filename in os.listdir(dir_):
img = cv2.imread(os.path.join(dir_,filename), cv2.IMREAD_UNCHANGED)
@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.button.java
Last active Sep 15, 2019
Prevent Double clicks on button Android
View android.button.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 Sep 15, 2019
simple init code from data science workspace Notebook Jupyter Colab Lab
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
Last active Sep 15, 2019
print 4 plots using grid area z reshape python meshgrid
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()])
You can’t perform that action at this time.