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
#Incomplete | |
from sqlalchemy import ( | |
create_engine, | |
MetaData, | |
Table | |
) | |
from sqlalchemy.orm import sessionmaker | |
sqlite_engine = create_engine('sqlite:///main.db', echo=True) |
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 os | |
path = os.getcwd() | |
for root, dirs, files in os.walk(path): | |
with open('names.txt', 'w') as f: | |
f.writelines([i +'\n' for i in 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
#from: https://stackoverflow.com/a/26494912 | |
$colItems = Get-ChildItem $startFolder | Where-Object {$_.PSIsContainer -eq $true} | Sort-Object | |
foreach ($i in $colItems) | |
{ | |
$subFolderItems = Get-ChildItem $i.FullName -recurse -force | Where-Object {$_.PSIsContainer -eq $false} | Measure-Object -property Length -sum | Select-Object Sum | |
$i.FullName + " -- " + "{0:N2}" -f ($subFolderItems.sum / 1MB) + " MB" | |
} |
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 os | |
def search(path, query): | |
results = [] | |
q = query.lower() | |
for root, dirs, files in os.walk(path): | |
for file in files: | |
if q in file.lower(): | |
results.append(os.path.join(root, name)) | |
for ls in dirs: |
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 bs4 import BeautifulSoup | |
import aiohttp | |
import asyncio | |
from datetime import datetime | |
import csv | |
loop = asyncio.get_event_loop() | |
client = aiohttp.ClientSession(loop=loop) | |
HEADERS = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0'} | |
BLOC = 'http://blocgame.com' |
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 | |
from bs4 import BeautifulSoup | |
s = requests.session() | |
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36'} | |
url = 'http://blocgame.com' | |
data = {'username': 'USERNAME', 'password': 'PASSWORD', 'login': ''} | |
s.headers['User-Agent'] = headers['User-Agent'] |
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 https://github.com/izy521/discord.io/blob/master/lib/index.js |
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 bs4 import BeautifulSoup | |
import aiohttp | |
import asyncio | |
import datetime | |
import csv | |
class Complete(KeyboardInterrupt): | |
pass |
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 bs4 import BeautifulSoup | |
from urllib.request import Request, urlopen | |
import datetime | |
import csv | |
start = datetime.datetime.now() | |
def get_countries(url): | |
try: |
NewerOlder