This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => 'https://portfolio-parser.api.casparser.in/v2/cams_karvy/parse', | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => '', | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"Etc/GMT+12": "Dateline Standard Time", "Etc/GMT+11": "UTC-11", "Pacific/Pago_Pago": "UTC-11", "Pacific/Niue": "UTC-11", "Pacific/Midway": "UTC-11", "America/Adak": "Aleutian Standard Time", "Pacific/Honolulu": "Hawaiian Standard Time", "Pacific/Rarotonga": "Hawaiian Standard Time", "Pacific/Tahiti": "Hawaiian Standard Time", "Pacific/Johnston": "Hawaiian Standard Time", "Etc/GMT+10": "Hawaiian Standard Time", "Pacific/Marquesas": "Marquesas Standard Time", "America/Anchorage": "Alaskan Standard Time", "America/Juneau": "Alaskan Standard Time", "America/Metlakatla": "Alaskan Standard Time", "America/Nome": "Alaskan Standard Time", "America/Sitka": "Alaskan Standard Time", "America/Yakutat": "Alaskan Standard Time", "Etc/GMT+9": "UTC-09", "Pacific/Gambier": "UTC-09", "America/Tijuana": "Pacific Standard Time (Mexico)", "America/Santa_Isabel": "Pacific Standard Time (Mexico)", "Etc/GMT+8": "UTC-08", "Pacific/Pitcairn": "UTC-08", "America/Los_Angeles": "Pacific Standard Time", "America/Vancouver": "Pacific Stan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pulp import pulp, constants as pulp_constants | |
items = [("a", 2), ("b", 0.5), ("c", 0.5), ("d", 0.5), ("e", 0.5), ("f", 0.5)] | |
itemCount = len(items) | |
maxBins = 3 | |
binCapacity = [4, 2, 2, 2] * 4 | |
binCost = binCapacity | |
y = pulp.LpVariable.dicts('BinUsed', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
responses = [] | |
WIX_SITE_URL = 'https://www.YOUR WIX SITE.com' | |
import xmltodict | |
import requests | |
import json | |
import csv | |
def get_blog_posts_urls(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this code in any Django app's admin.py | |
# Works for all Task Statuses; you can filter them in line 12. | |
import ast | |
import importlib | |
import json | |
from django.contrib import admin | |
from django.contrib import messages | |
from django.utils.safestring import mark_safe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"AmazonMws":{"predefinedPackages":[],"serviceLevels":["UPS Rates","USPS Rates","FedEx Rates","UPS Labels","USPS Labels","FedEx Labels","UPS Tracking","USPS Tracking","FedEx Tracking"]},"APC":{"predefinedPackages":[],"serviceLevels":["parcelConnectBookService","parcelConnectExpeditedDDP","parcelConnectExpeditedDDU","parcelConnectPriorityDDP","parcelConnectPriorityDDPDelcon","parcelConnectPriorityDDU","parcelConnectPriorityDDUDelcon","parcelConnectPriorityDDUPQW","parcelConnectStandardDDU","parcelConnectStandardDDUPQW","parcelConnectPacketDDU"]},"Asendia":{"predefinedPackages":[],"serviceLevels":["PMI","ePacket","IPA","ISAL"]},"AsendiaUsa":{"predefinedPackages":[],"serviceLevels":["ADS","AirFreightInbound","AirFreightOutbound","AsendiaDomesticBoundPrinterMatterExpedited","AsendiaDomesticBoundPrinterMatterGround","AsendiaDomesticFlatsExpedited","AsendiaDomesticFlatsGround","AsendiaDomesticParcelGroundOver1lb","AsendiaDomesticParcelGroundUnder1lb","AsendiaDomesticParcelMAXOver1lb","AsendiaDomesticParcelMAXUnder1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Albania Lek", | |
"code": "ALL", | |
"decimal_code": "Lek", | |
"sign": "Lek" | |
}, | |
{ | |
"name": "Afghanistan Afghani", | |
"code": "AFN", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for k in $(git branch | sed /\*/d); do | |
if [ -n "$(git log -1 --before='4 months ago' -s $k)" ]; then | |
git branch -d $k | |
git push origin --delete $k | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For handling Shopify 429 - https://gist.github.com/wowkin2/079844c867a1a06ce15ea1e4ffdee87c | |
def patch_shopify(): | |
connection_func = ShopifyConnection._open | |
decode_func = formats.JSONFormat.decode | |
def patch_decode(resource_string): | |
count_format_error = 0 | |
while count_format_error <= 2: | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
To match Date such as "20-21-2018" | |
(\d{2})[/.-](\d{2})[/.-](\d{4})$ | |
To match Mobile number such as "9810284901" | |
^[0][1-9]\d{9}$|^[1-9]\d{9}$ | |
To match a URL | |
^.*http.*$ | |
''' | |
import requests |
NewerOlder