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
/* | |
* Adds a team to all the repos in a Github organization. This is a tedious | |
* process in the UI. You'll need a newer version of node to run this (e.g 9+) | |
* because it uses async/await. | |
* | |
* Instructions: | |
* | |
* 1. Copy this file somewhere on your computer, e.g. ~/addteamrepos.js | |
* 2. Fill in the uppercase variables below with the right values | |
* 3. Run this file: `$ node ~/addteamrepos.js` |
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
CREATE OR REPLACE FUNCTION parse_pdf_date(pdf_date TEXT) RETURNS TIMESTAMP WITH TIME ZONE AS $$ | |
DECLARE | |
timestamp_part TEXT; | |
tz_offset TEXT; | |
clean_tz_offset TEXT; | |
parsed_timestamp TIMESTAMP; | |
BEGIN | |
-- Return NULL if the input is NULL or does not start with 'D:' | |
IF pdf_date IS NULL OR pdf_date !~ '^D:\d+' THEN | |
RETURN NULL; |
OlderNewer