Skip to content

Instantly share code, notes, and snippets.

View alshell7's full-sized avatar

Owais alshell7

View GitHub Profile
@jemshit
jemshit / proguard-rules.pro
Last active April 27, 2024 08:54
Proguard Rules for Android libraries
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
### RxJava, RxAndroid (https://gist.github.com/kosiara/487868792fbd3214f9c9)
-keep class rx.schedulers.Schedulers {
public static <methods>;
@hbcafe
hbcafe / gist:a16f0546fe56f687d9da994593b55a92
Created October 18, 2016 17:58
Connect native Android app to Watson Sentiment Analysis in under 10 minutes
package com.ibm.sentimentsensitiveapp;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
@jbgo
jbgo / Makefile
Created September 2, 2016 16:41
My vagrant setup for python flask apps
SHELL = /bin/bash
WORKDIR = /vagrant
PSQL = sudo -u postgres psql
DBNAME = changeme
DBUSER = changeme_user
DBPASS = secret
db/console:
$(PSQL) $(DBNAME)
@alshell7
alshell7 / async_task.md
Last active June 17, 2016 19:46
Androids AsyncTask Explanation

##Basically AsyncTask uses generic types in its parameters The three types used by an asynchronous task are the following:

  • Params, the type of the parameters sent to the task upon execution.
  • Progress, the type of the progress units published during the background computation.
  • Result, the type of the result of the background computation.

Not all types are always used by an asynchronous task. To mark a type as unused, simply use the type Void: private class MyTask extends AsyncTask<Void, Void, Void> { ... }

##Taking a very known and common example..

@maximilian-lindsey
maximilian-lindsey / express_in_electron.md
Last active March 29, 2024 22:46
How to run Express inside an Electron app

How to run Express inside an Electron app

You can run your Express app very easily inside your Electron app.

All you need to do is to:

  • place all the files of your Express app inside a new app folder in your_electron_app\resources\app
  • reconfigure the app.js file
  • refactor some relative pathes in your Express app
@okamayana
okamayana / ndk_basics.md
Last active January 15, 2024 23:34
Android Studio: Writing and calling JNI functions

Purpose

Writing JNI functions

  1. Create a new Android Studio project. To do so, select File -> New -> New Project.
@fahimbabarpatel
fahimbabarpatel / Mongodb restore and dump commands via json, bson and csv.md
Last active June 1, 2023 10:11
Mongodb restore and dump commands via json, bson and csv

NOTE -

  • Remove -h option if you are doing operation on same machine
  • Remove -u , -p option if your database don't have username and password

Binary

Import database

mongorestore -h IP:port -d DB_Name -u user_name -p password <input db directory>
@sureshdsk
sureshdsk / facebook-graph-api-page.py
Last active March 25, 2019 15:23
Get number of likes of a facebook page using graph api in python
# http://www.idiotinside.com/2015/02/13/get-number-of-likes-of-a-facebook-page-using-graph-api-in-python/
import urllib2
import json
def get_page_data(page_id,access_token):
api_endpoint = "https://graph.facebook.com/v2.4/"
fb_graph_url = api_endpoint+page_id+"?fields=id,name,likes,link&access_token="+access_token
try:
api_request = urllib2.Request(fb_graph_url)
@TheRook
TheRook / spf.py
Last active March 4, 2024 18:27 — forked from moloch--/spf.py
#!/usr/bin/env python
import dns.resolver
import dns.name
#import netaddr
from urlparse import urlparse
INFO = "\033[1m\033[36m[*]\033[0m "
@finnigja
finnigja / dnsdiff.py
Last active July 26, 2022 02:36
Script for comparing DNS lookup results across multiple resolvers
#!/usr/bin/env python
#
# DNS Result Comparison Utility
# Author: https://twitter.com/chair6
#
import argparse
import dns.resolver
import dns.rdatatype
from collections import defaultdict