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
#!/usr/bin/env ruby | |
require 'ftools' | |
require 'fileutils' | |
require 'rubygems' | |
require 'RMagick' | |
include Magick | |
require 'open3' | |
def merge( files = [] ) |
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
#!/usr/bin/env python3 | |
__author__ = 'Sushain K. Cherivirala' | |
import argparse | |
import cmd | |
import collections | |
import contextlib | |
import copy | |
import datetime |
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
# https://nlpforhackers.io/named-entity-extraction/ | |
import os | |
import string | |
import collections | |
import pickle | |
from collections import Iterable | |
from nltk.tag import ClassifierBasedTagger | |
from nltk.chunk import ChunkParserI, conlltags2tree, tree2conlltags |
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 python:3.7.8-alpine3.12 | |
RUN apk add --no-cache python3-dev libffi-dev gcc musl-dev make git | |
#RUN pip install redis gevent fire | |
#RUN pip install celery==4.4.6 | |
#RUN pip install git+https://github.com/celery/celery.git@455e0a0e86679eaaba9f0da533066627b1d79296#egg=celery | |
WORKDIR /app | |
COPY requirements.txt /app/requirements.txt | |
RUN pip install -r requirements.txt |
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 selenium import webdriver | |
from selenium.webdriver.common.proxy import Proxy | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities | |
from selenium.webdriver.chrome.options import Options | |
import zipfile,os | |
def proxy_chrome(PROXY_HOST,PROXY_PORT,PROXY_USER,PROXY_PASS): | |
manifest_json = """ | |
{ |
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 django import http | |
from django.utils.http import urlquote | |
from django import urls | |
from django.conf import settings | |
from django.utils.deprecation import MiddlewareMixin | |
class AppendOrRemoveSlashMiddleware(MiddlewareMixin): | |
"""Like django's built in APPEND_SLASH functionality, but also works in | |
reverse. Eg. will remove the slash if a slash-appended url won't resolve, |
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 // do not copy this line | |
/** | |
* add_new_topic_hooks will add a new webhook topic hook. | |
* @param array $topic_hooks Esxisting topic hooks. | |
*/ | |
function add_new_topic_hooks( $topic_hooks ) { | |
// Array that has the topic as resource.event with arrays of actions that call that topic. |
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
import asyncio | |
from django import http | |
from django.core.urlresolvers import set_script_prefix | |
from django.utils.encoding import force_str | |
from django.core.handlers.wsgi import get_script_name | |
from django_wsgi.handler import DjangoApplication | |
import logging | |
import logging | |
import sys |
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
# Put the following in shopify_app.authentication.py. This assumes we have a | |
# custom User model in shopify_app.models with a unique myshopify_domain | |
# attribute. The Shopify app API key and shared secret are imported from | |
# settings.py. | |
import datetime | |
import jwt | |
from datetime import timezone | |
from rest_framework import authentication | |
from rest_framework import exceptions |
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
# https://hakibenita.com/how-to-turn-django-admin-into-a-lightweight-dashboard | |
from django.contrib import admin | |
from django.db.models import Count, Sum, Min, Max, DateTimeField | |
from django.db.models.functions import Trunc | |
from . import models | |
def get_next_in_date_hierarchy(request, date_hierarchy): |
OlderNewer