exiftool -DateTimeOriginal-=4 -overwrite_original *.jpg
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 pathlib import Path | |
from datetime import datetime | |
files = [f for f in Path().iterdir() if f.suffix == '.md'] | |
files | |
template = Path('template').read_text() | |
template | |
def apply(source, template): |
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 | |
import argparse | |
from collections import namedtuple, defaultdict | |
from collections.abc import Generator | |
from datetime import datetime | |
from pathlib import Path | |
from zoneinfo import ZoneInfo # requires `pip install tzdata` on Windows | |
FIELDS = ['TICKER', 'PRICE', 'VOL', 'TIMESTAMP'] |
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 | |
""" | |
Convert ticker-based files from https://stooq.com/db/h/ into date-based files | |
""" | |
import argparse | |
from collections import namedtuple, defaultdict | |
from collections.abc import Generator | |
from datetime import datetime, date | |
from pathlib import Path |
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
#SingleInstance | |
; get filename | |
SplitPath, A_ScriptName, OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive | |
; convert text to number | |
minutes := OutNameNoExt, minutes += 0 | |
; set minutes 30 if the conversion above failed | |
if minutes is space |
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
exiftool "-FileName<CreateDate" -d "%Y%m%d %H%M%S.%%e" . | |
exiftool "-FileModifyDate<FileName" "-FileCreateDate<FileName" "-AllDates<FileName" -overwrite_original -P -r -ext jpg ./ | |
exiftool "-FileModifyDate<FileName" "-FileCreateDate<FileName" "-AllDates<FileName" -overwrite_original -P -r -ext mov ./ | |
exiftool "-FileModifyDate<FileName" "-FileCreateDate<FileName" "-AllDates<FileName" -overwrite_original -P -r -ext mp4 ./ | |
# Regenerate broken movie files | |
# exiftool -time:all -a -G0:1 -s "20130607 190850.m4v" | |
# ffmpeg -i "20130607 190850.m4v" -acodec copy -vcodec copy -f mov "20130607 190850.mov" |
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 subprocess import call | |
from time import sleep | |
from selenium import webdriver | |
from pathlib import Path | |
DRIVER_PATH = 'C:/Users/y/AppData/Local/Google/Chrome/chromedriver.exe' | |
SOURCE_PATH = 'source' | |
BUILD_PATH = 'build' | |
INTERVAL = 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
""" | |
Output: | |
### 2020-06-08 12:00 | |
Title and contents are here | |
### 2020-06-09 12:00 | |
Another title and contents are here | |
""" |
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 logging | |
from collections import defaultdict | |
from dataclasses import dataclass | |
from multiprocessing import Pipe, Process, Queue | |
from multiprocessing.connection import Connection, wait | |
from os import cpu_count | |
from random import randint | |
from threading import Thread | |
from time import sleep | |
from typing import Any, Callable, DefaultDict, Dict, List, Optional, Set, TypeVar |
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
MButton:: | |
if (A_ThisHotkey = A_PriorHotkey and A_TimeSincePriorHotkey < 200) | |
Send, ^w | |
else | |
Send, {MButton} | |
Return | |
RButton:: | |
if (A_ThisHotkey = A_PriorHotkey and A_TimeSincePriorHotkey < 200) { | |
Send, {Browser_Back} |
NewerOlder