This file contains hidden or 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 hashlib | |
import os | |
import re | |
rex = re.compile(r'2017-B\.7z\.\d{3}', re.IGNORECASE) | |
# Credit to Glen Thompson for posting these | |
target_hashes = { | |
'2017-B.7z.001': '2a0a9ea08883ee372e87dc5c1a7019fd', | |
'2017-B.7z.002': '3118c66475aca07f6de42993189194cc', |
This file contains hidden or 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 to Module 1 | |
Option Explicit | |
Private Const PAGE_EXECUTE_READWRITE = &H40 | |
Private Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" _ | |
(Destination As Long, Source As Long, ByVal Length As Long) | |
Private Declare Function VirtualProtect Lib "kernel32" (lpAddress As Long, _ |
This file contains hidden or 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
#Testcoding: utf-8 | |
import time | |
import win32com | |
import win32com.client | |
labels_to_print = """ | |
Label 1 | |
Label 2 | |
Label 3 | |
""".splitlines() |
This file contains hidden or 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
Public Sub Test() | |
Dim c As Word.cell | |
Set c = Selection.Tables(1).cell(1, 1) | |
For Each c In Selection.Cells | |
c.Range.Text = "$NIL" | |
Next c |
This file contains hidden or 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
Sub GlossaryMaker() | |
' | |
' GlossaryMaker Macro | |
' | |
'========================= | |
'Macro created 2008 by Lene Fredborg, DocTools - www.thedoctools.com | |
'THIS MACRO IS COPYRIGHT. YOU ARE WELCOME TO USE THE MACRO BUT YOU MUST KEEP THE LINE ABOVE. | |
'YOU ARE NOT ALLOWED TO PUBLISH THE MACRO AS YOUR OWN, IN WHOLE OR IN PART. | |
'========================= | |
'The macro creates a new document, |
This file contains hidden or 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
# If errors are found, do this | |
# clear contents of C:\Users\<username>\AppData\Local\Temp\gen_py | |
# that should fix it, to test it type | |
import win32com.client | |
app = win32com.client.gencache.EnsureDispatch('Word.Application') | |
app.Visible = True |
This file contains hidden or 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
In a Custom Text Field, create a formula such as: | |
Start: | |
"T" & IIf(ProjDateDiff(#16/04/2018#,[Start])>=0,"+","") & ProjDateDiff(#16/04/2018#,[Start])/480 & "d" | |
Finish: | |
"T" & IIf(ProjDateDiff(#16/04/2018#,[Finish])>=0,"+","") & ProjDateDiff(#16/04/2018#,[Finish])/480 & "d" |
This file contains hidden or 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, time, datetime | |
from copy import copy, deepcopy | |
from collections import OrderedDict | |
import string | |
import math | |
import win32com.client | |
import traceback | |
# Sample code for accessing MSProject | |
# 2014 (C) Zohar Lorberbaum |
This file contains hidden or 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
current_path = os.path.dirname(sys.argv[0]) | |
os.chdir(current_path) | |
ROOT = r'.' |
This file contains hidden or 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 psycopg2 | |
conn = psycopg2.connect("dbname='timesheets' user=postgres") | |
if True: | |
cur = conn.cursor() | |
sql = """ | |
CREATE TABLE IF NOT EXISTS \"public\".\"ts\" ( | |
id serial primary key, | |
dt date, | |
project text, |
OlderNewer