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 / MyAccessibilityService.java
Last active Sep 9, 2018
use AccessibilityService on Anrdoid
View MyAccessibilityService.java
public class MyAccessibilityService extends AccessibilityService {
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
clickOnButton(event,"OK")
}
private static void clickOnButton(AccessibilityEvent event, String label) {
if (event.getSource() != null) {
for (AccessibilityNodeInfo nodeButton
: event.getSource().findAccessibilityNodeInfosByText(label)) {
@romellfudi
romellfudi / readFile.py
Created Sep 9, 2018
Simple read file in python
View readFile.py
lines = [line.rstrip('\n') for line in open('training_data.json')]
@romellfudi
romellfudi / ecdf.py
Created Sep 9, 2018
Empirical cumulative distribution function
View ecdf.py
def ecdf(data):
n = len(data)
x = np.sort(data)
y = np.arange(1, n+1) / n
return x, y
@romellfudi
romellfudi / gradle-java.sh
Last active Sep 26, 2018
gradle create project via terminal
View gradle-java.sh
gradle init --type java-library
gradle init --type java-application
@romellfudi
romellfudi / path.py
Last active Oct 8, 2018
get concatenate paths
View path.py
data_dir = '{}'.format(os.sep).join([module.__path__[0], 'test', 'test_data']) + os.sep
data_dir # module/test/test_data/
from os.path import expanduser
home = expanduser("~")
@romellfudi
romellfudi / hosting-on-github.md
Last active Oct 9, 2018 — forked from TylerFisher/hosting-on-github.md
Basic steps for hosting on Github
View hosting-on-github.md

Steps for Hosting a Website on GitHub

  1. Create a GitHub account on github.com.
  2. Download either [GitHub for Mac][1] or [GitHub for Windows][2], depending on your operating system. Open the app and log in using the account you just created.
  3. (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
  4. Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
  5. Move your website's files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level directory.
  6. Back in the GitHub application, you should see your files in the left column. Make sure they are all checked. If so, enter a mess
View list_all_files.py
import os;os.listdir(os.curdir)
@romellfudi
romellfudi / android_photo.java
Created Dec 10, 2018
Take a photo in Android N
View android_photo.java
private void selectImage() {
final CharSequence[] options = {"Take Photo", "Choose From Gallery", "Cancel"};
android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(this);
builder.setTitle("Select Option");
builder.setItems(options, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int item) {
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
if (options[item].equals("Take Photo")) {
@romellfudi
romellfudi / java.keystore.sh
Last active Jan 22, 2019
View java keystore
View java.keystore.sh
On MAC
cd /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/
keytool -list -v -keystore "/Users/romelldominguez/.android/debug.keystore"
On Windows
"C:\Program Files\Java\jre7\bin\keytool" -list -v -keystore "C:\Users\Fudi\.android\debug.keystore"
@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>
You can’t perform that action at this time.