This covers how to get a date range in Python using only standard library modules.
"""
MIT LICENSED
(c) 2023 Jason R. Stevens, CFA
"""
pbpaste | base64 | pbcopy
on mac or xclip -selection clipboard -o | base64 -w 0 | xclip -selection clipboard
on 'nix systemsconst private_key = new Buffer(process.env.PRIVATE_KEY, 'base64').toString('ascii');
From Github's documentation, the below demonstrates how-to explicitly change the permission mode of a file so that it doesn’t get reset every time there is a clone/fork.
git update-index --chmod=+x <filename>
For example, to give entrypoint.sh
executable permissions:
type CloudinaryPayload = { | |
id: string; | |
batchId: string; | |
asset_id: string; | |
public_id: string; | |
version: number; | |
version_id: string; | |
signature: string; | |
width: number; | |
height: number; |
Today we ran into an issue adding a multi-database setup to prior single-db setup. Here's how we fixed it and reference links.
From the maintainer of Flask-Migrate, Miguel Grinberg:
I was able to convert a single-db repository to multi-db with the following procedure:
migrations
folder to something else (i.e. migrations-old
)"You write a test by creating a file with a name ending in _test.go
that contains functions named TestXXX with signature func (t *testing.T)
.
The test framework runs each such function; if the function calls a failure function such as
t.Error
or t.Fail
, the test is considered to have failed."
📓 Reference: https://go.dev/doc/code.
To test a file named reverse.go
simply create a file named reverse_test.go
in the package directory
with the following content:
"To remove all downloaded modules, you can pass the -modcache flag to go clean:"
go clean -modcache
📓 Reference: https://go.dev/doc/code
#! /usr/bin/sh | |
# A simple script to upload the file given via the single input parameter | |
# via the full path to the file. | |
# This uses Python to grab the filename, since bash and other shell | |
# scripting languages are comparably unreadable. | |
bucket_name=<that-sexy-bucket-name-of-yours> | |
bucket=s3://$bucket_name/ | |
input=$1 | |
filename=$(python3 -c "print('$1'.split('/')[-1])") |