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 argparse | |
from io import TextIOWrapper | |
from pathlib import Path | |
from typing import Optional, Tuple | |
def split_file(*, input_path: Path, output_file_prefix: str, output_file_suffix: Optional[str], lines_per_chunk: int, has_header: bool = True) -> list[Path]: | |
def build_filename() -> Path: | |
if output_file_suffix is None: | |
return input_path.parent.joinpath(f'{output_file_prefix}_{chunk_number}{input_path.suffix}') |
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
require 'date' | |
require 'json' | |
def get_seconds_difference(start, finish) | |
((finish - start) * 24 * 60 * 60).to_i | |
end | |
# from gh run list --branch main --event push --status completed --json displayTitle,headSha,name,databaseId,startedAt,updatedAt,workflowName --limit 1000 > run_list.json | |
data = JSON.parse(File.read('./run_list.json')) |
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
select s.typname as source, t.typname as target, castcontext, castmethod | |
from pg_cast | |
left join pg_type as s on castsource = s.oid | |
left join pg_type as t on casttarget = t.oid; |
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 | |
set -eu | |
# Expects two Heroku app names as arguments | |
# Displays the diff of the environment variable *names* (ignoring their values) | |
args=("$@") | |
first_app_var_names=$(heroku config -s --app ${args[0]} | sed -E 's/=.*$//') | |
second_app_var_names=$(heroku config -s --app ${args[1]} | sed -E 's/=.*$//') |
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 | |
app_list=$(heroku apps -A -t=${@} | grep -v '^===') | |
for app in $app_list; do | |
buildpacks=$(heroku buildpacks -a $app | grep -v '^===' | sed -E 's/[0-9]+\. //') | |
if [[ $buildpacks =~ "has no Buildpack URL set" ]]; then | |
echo $app "has no buildpacks" | |
else | |
for buildpack in $buildpacks; do |
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
const { StatusCake, getTests, getContactGroups, updateTest } = require('statuscakejs') | |
const uniq = require('lodash.uniq') | |
// get these from Account > User Details | |
const statusCake = new StatusCake('username', 'apiKey') | |
let allTests | |
getTests(statusCake).then(data => allTests = data) | |
let allContacts |