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 urllib3 | |
from bs4 import BeautifulSoup | |
from dateutil import parser | |
my_date = '26/05/2016' | |
dt = parser.parse(my_date) | |
url_to_scrape = "http://www.analogman.com/kotdelay.htm" | |
http = urllib3.PoolManager() |
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 win32com.client import Dispatch | |
import subprocess | |
import socket_client | |
def openExcel(workbook): | |
xl = Dispatch("Excel.Application") | |
xl.visible = True | |
wb = xl.Workbooks.Open(workbook) | |
def checkOpenApp(appname): |
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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
#IfWinActive, Oracle SQL Developer | |
::header ::dcsdba.order_header oh | |
::line ::dcsdba.order_line ol |
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 python | |
import os | |
import json | |
import time | |
def listFolders(folderpath): | |
""" | |
Iterates through the child folders of folderpath | |
and adds items to a list object. |
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 _winreg | |
outlook_security = _winreg.OpenKey( | |
_winreg.HKEY_CURRENT_USER, | |
"Software\\Policies\\Microsoft\\office\\12.0\\Outlook\\Security" | |
) | |
settings = {'PromptOOMItemPropertyAccess':2, | |
'PromptOOMSend' : 2, | |
'PromptOOMAddressBookAccess' : 2, |
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 python | |
import os | |
import json | |
import time | |
def listFolders(folderpath): | |
""" | |
Iterates through the child folders of folderpath | |
and adds items to a list object. |
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 socket | |
import sys | |
PORT = 8000 | |
IP = '197.168.1.67' | |
serversocket = socket.socket( | |
socket.AF_INET, socket.SOCK_STREAM) | |
serversocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) |
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 socket | |
from time import strftime | |
IP = "192.168.1.67" | |
PORT = 8000 | |
MESSAGE = "Hi there!" | |
def sendMessage(message, ip_address=IP, port=PORT): | |
message = strftime("%Y-%m-%d %H:%M:%S") + message | |
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
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 datetime import * | |
# date, timedelta | |
week = { | |
0: 1, # remap so Sunday = 0 | |
1: 2, | |
2: 3, | |
3: 4, | |
4: 5, | |
5: 6, |
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 | |
# goal is to use the dictionary and return the value | |
# using the key in a sql statement. | |
# eg instead of having this table in the DB we can hack it in | |
# even import it from excel. | |
import sqlite3 |
NewerOlder