Skip to content

Instantly share code, notes, and snippets.

View codeslord's full-sized avatar
🤖
I'm not a robot, I just speak their language.

Rohith Raghunathan Nair codeslord

🤖
I'm not a robot, I just speak their language.
View GitHub Profile
from zipfile import ZipFile
from plistlib import loads
archive = ZipFile('Kodi19Alpha64bit.ipa')
plist_file = archive.read('Payload/Kodi.app/Info.plist')
pl = loads(plist_file)
pl['CFBundleDisplayName'] #output: 'Kodi'
# Copying folders
self.output_dir = output_dir
if output_dir is not None:
if not os.path.isdir(output_dir):
os.makedirs(output_dir)
html_index_path = pkg_resources.resource_filename("droidbot", "resources/index.html")
stylesheets_path = pkg_resources.resource_filename("droidbot", "resources/stylesheets")
images_path = pkg_resources.resource_filename("droidbot", "resources/images")
target_stylesheets_dir = os.path.join(output_dir, "stylesheets")
import threading
import time
class ThreadingExample(object):
""" Threading example class
The run() method will be started and it will run in the background
until the application exits.
"""
import datetime
import email
import imaplib
import mailbox
EMAIL_ACCOUNT = "your@gmail.com"
PASSWORD = "your password"
mail = imaplib.IMAP4_SSL('imap.gmail.com')
# Categorical boolean mask
categorical_feature_mask = X.dtypes==object
# filter categorical columns using mask and turn it into a list
categorical_cols = X.columns[categorical_feature_mask].tolist()
# import labelencoder
from sklearn.preprocessing import LabelEncoder
# instantiate labelencoder object
le = LabelEncoder()
#!/usr/bin/env python
"""
This is a small demo file that helps teach how to adjust figure sizes
for matplotlib
"""
import matplotlib
print "using MPL version:", matplotlib.__version__
matplotlib.use("WXAgg") # do this before pylab so you don'tget the default back end.
!pip install -U --no-deps mapclassify git+git://github.com/geopandas/geopandas.git@master
!pip install pysal==2
!pip install fiona
!pip install pyproj
%matplotlib inline
import geopandas as gpd
import matplotlib as mpl # make rcParams available (optional)
mpl.rcParams['figure.dpi']= 144 # increase dpi (optional)
world = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
pairs = set( [(0,1),(0,1),(1,0),(1,2),(1,0),(2,1)] )
set((a,b) if a<=b else (b,a) for a,b in pairs)
or
pairs = set(frozenset(p) for p in ((0,1),(0,1),(1,0)) )
import os
from flask import Flask, request, redirect, url_for,send_from_directory
from werkzeug import secure_filename
UPLOAD_FOLDER = 'uploads/'
ALLOWED_EXTENSIONS = set(['ipa'])
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
import sys
def tracefunc(frame, event, arg, indent=[0]):
if event == "call":
indent[0] += 2
print("-" * indent[0] + "> call function", frame.f_code.co_name)
elif event == "return":
print("<" + "-" * indent[0], "exit function", frame.f_code.co_name)
indent[0] -= 2
return tracefunc