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
''' | |
author: Pure Python | |
url: https://www.purepython.org | |
copyright: CC BY-NC 4.0 | |
creation date: 22-12-2018 | |
This script takes a folder and renames all the files | |
to the same name with auto increment numbers. | |
It keeps the extensions of each file unchanged |
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
$m = new MongoClient(); // connect to local mongodb | |
$db = $m->products; //select 'mongo database' named products | |
$clothing_col = $db->clothing; //create a collection from the 'table' clothing | |
//create the aggregation | |
//create the Match on clothing-category = shoes or brand = nike AND size 37 | |
$ops = array( | |
array( | |
'$match' => array('$or' => array(array("category" => 'shoes'), | |
array("brand" => 'nike')), |
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 requests | |
import calendar | |
import time | |
import datetime | |
from bs4 import BeautifulSoup | |
username = "" # fill in your slimmemeterportal username | |
password = "" # fill in your password | |
start_year = "" # fill in the year your started measurements |
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
# sudo -H pip install xlrd | |
# pip install beautifulsoup4 | |
# maybe you should install the above python items | |
import time | |
import logging | |
import os | |
import urllib | |
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
$today = strtotime(date('Y-m-d 00:00:00')); | |
$yesterday = strtotime(date('Y-m-d 00:00:00', (time() - 24 * SECONDS_PER_HOUR))); | |
$m = new MongoClient(); // connect to local mongodb | |
$db = $m->orders; //select 'mongo database' named orders | |
$items_col = $db->items; //create a collection from the 'table' ordered items | |
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
# SuDoKu Solver in Python | |
# With special thanks to Computerphile (Danke Thorsten!) | |
# https://www.youtube.com/watch?v=G_UYXzGuqvM FUN TO WATH | |
# Make a list of each row of Sudoku numbers, empty = 0 | |
# Put each list (row) in a list and run! | |
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
bulk_exports: | |
- | |
file: all_inlinks.csv | |
name: All Inlinks | |
- | |
file: all_outlinks.csv | |
name: All Outlinks | |
- | |
file: queued_urls.csv | |
name: Queued 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
import sys | |
import pytesseract | |
from pathlib import Path | |
from glob import glob | |
from os.path import join | |
class ImageOcr: | |
def __init__(self, my_path: Path = None): |
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 requests | |
import json | |
import os | |
import re | |
import yaml | |
class ImportMDs: | |
def __init__(self, m_token=None, git_username=None): | |
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
import json | |
import requests | |
import csv | |
import datetime | |
class WooCommerceCVS: | |
def __init__(self): | |
self.woo_sfields = ['title', 'sku', 'price', 'description'] |