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 datetime | |
dates = ['20220902', '20220909', '20220916', '20220923', '20220930', | |
'20221007', '20221014', '20221021', '20221118', '20221216', | |
'20230120', '20230317', '20230421', '20230616', '20230915', | |
'20240119', '20240315', '20240621'] | |
# [ datetime.date(2022, 9, 2), datetime.date(2022, 9, 9), datetime.date(2022, 9, 16), ... ] | |
dates = [datetime.datetime.strptime(d, '%Y%m%d').date() for d in dates] |
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
--- t 2022-07-06 14:23:36.859694051 +0200 | |
+++ v 2022-07-06 14:23:36.363691598 +0200 | |
@@ -1,94 +1,53 @@ | |
-def sync_table(conn_info, stream, state, desired_columns, md_map): | |
+def sync_view(conn_info, stream, state, desired_columns, md_map): | |
time_extracted = utils.now() | |
# before writing the table version to state, check if we had one to begin with | |
first_run = singer.get_bookmark(state, stream['tap_stream_id'], 'version') is 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
#!/bin/sh | |
# | |
# Git pre-commit hook to test the developer didn't forget to create database migrations | |
# and that all migration files are staged for commit. | |
# | |
# Note: chmod +x .git/hooks/pre-commit | |
# | |
echo "pre-commit: Checking for forgotten/untracked/unstaged migrations..." |
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
#!/bin/bash | |
# stop on first error | |
#set -e | |
# match patterns in a case-insensitive fashion when performing matching while executing case or [[ | |
shopt -s nocasematch | |
RESIZE="" | |
TRIM="" |
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 hashlib | |
from functools import wraps | |
from django.core import cache # Importing this way so debug_toolbar can patch it later. | |
from django.core.cache.backends.base import DEFAULT_TIMEOUT | |
ALLOWED_CACHED_FUNCTION_ARG_TYPES = set((type(None), int, float, long, bool, str, unicode)) | |
def cached_function(func=None, num_args_to_key=None, timeout=DEFAULT_TIMEOUT): |