Skip to content

Instantly share code, notes, and snippets.

View zkhan93's full-sized avatar
🎯
Focusing

Zeeshan Khan zkhan93

🎯
Focusing
View GitHub Profile
@zkhan93
zkhan93 / json_array_splitter.py
Last active September 7, 2022 18:25
huge JSON array objects splitter
import click
from functools import wraps
import mmap
import time
import multiprocessing
import json
import os
c2n = {"{": 123, "}": 125, "[": 91, "]": 93}
track = {
[{
"quote": "Four things support the world: the learning of the wise, the justice of the great, the prayers of the good, the valour of the brave.",
"author": "Muhammad (peace be upon him)"
}, {
"quote": "Kindness is a mark of faith, and whoever has not kindness has not faith.",
"author": "Muhammad (peace be upon him)"
}, {
"quote": "To overcome evil with good is good, to resist evil by evil is evil.",
"author": "Muhammad (peace be upon him)"
}, {
@zkhan93
zkhan93 / card_brands.json
Created March 18, 2020 18:07
used to detect card brands
{
"american_express" : {
"34" : ["15"],
"37" : ["15"]
},
"diners_club": {
"36": ["14-19"],
"300-305": ["16-19"],
"3095": ["16-19"],
"38-39": ["16-19"]
@zkhan93
zkhan93 / Mr. Falcon Privacy Policy.md
Last active January 28, 2020 14:22
Mr. Falcon Privacy Policy

#Mr. Falcon Terms of Service and Privacy Policy

  1. Terms

By accessing the website/application at google Home identified by name "Mr.Falcon", you are agreeing to be bound by these terms of service, all applicable laws and regulations, and agree that you are responsible for compliance with any applicable local laws. If you do not agree with any of these terms, you are prohibited from using or accessing this site. The materials contained in this website are protected by applicable copyright and trademark law.

  1. Use License

Permission is granted to temporarily download one copy of the materials (information or software) on Mr. Falcon's website for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title, and under this license you may not: modify or copy the materials;

Privacy Policy of Mr. Dobby

Privacy Policy Effective date: October 06, 2019

Mr. Dobby ("us", "we", or "our") operates the Mr. Dobby mobile application (the "Service").

This page informs you of our policies regarding the collection, use, and disclosure of personal data when you use our Service and the choices you have associated with that data. Our Privacy Policy for Mr. Dobby is created with the help of the Free Privacy Policy Generator.

We use your data to provide and improve the Service. By using the Service, you agree to the collection and use of information in accordance with this policy. Unless otherwise defined in this Privacy Policy, terms used in this Privacy Policy have the same meanings as in our Terms and Conditions.

@zkhan93
zkhan93 / no_namespace_query.py
Created September 22, 2019 13:35
simple xpath lookup without namespaces
from lxml import etree
import re
p = re.compile(r'\{.*\}(.*)')
a = """<a xmlns="http://google.com">
<b xmlns="http://facebook.com">
<d>
<x></x>
</d>
@zkhan93
zkhan93 / logging.py
Created July 26, 2019 20:10
basic python logging config
import logging
import logging.config
import sys
logfilename = 'app.log'
logging.config.dictConfig({
'version': 1,
'root': {
'level': logging.INFO,
@zkhan93
zkhan93 / utils.js
Last active January 5, 2019 20:34
Vuejs utility mixin with common use cases
var utils = {
methods: {
loadv2(items, callback) {
// items is an array of loadConfigs
// loadConfig = {name, url, variableName, dataInReponse}
// name- visible name to user in loading text
// url - url to hit a get request
// variableName - save received data back in
// dataInReponse - reponse data present in this variable
var vm = this
@zkhan93
zkhan93 / basewebservices.py
Created December 7, 2018 15:42
Helper classes to define and consume client HTTP based service using requests
from abc import ABCMeta, abstractproperty, abstractmethod
from pprint import pformat
from defusedxml import ElementTree
from collections import namedtuple
import requests
import logging
import json
logger = logging.getLogger('app')
@zkhan93
zkhan93 / quotes.json
Last active April 26, 2024 15:20
quotes to be used by conky ;)
[
{
"quote": "Patience Ensures Victory.",
"author": "Ali ibn Abi Talib"
},
{
"quote": "Do for this life as if you live forever, do for the afterlife as if you die tomorrow.",
"author": "Ali ibn Abi Talib"
},
{