I hereby claim:
- I am anson-vandoren on github.
- I am ansonvandoren (https://keybase.io/ansonvandoren) on keybase.
- I have a public key whose fingerprint is 86A6 C0BC 74C3 0D71 BE11 C590 2D1D A511 8D1B C5BD
To claim this, I am signing this object:
#!/bin/bash | |
if ! command -v gum &> /dev/null; then | |
echo "gum not found. To install:" | |
echo "sudo mkdir -p /etc/apt/keyrings" | |
echo "curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg" | |
echo 'echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list' | |
echo "sudo apt update && sudo apt install gum" | |
exit 1 | |
fi |
class Solution: | |
def brokenCalc(self, x: int, y: int) -> int: | |
if y < x: | |
return x - y | |
# find next power of 2 | |
next_highest_power_of_two = 1 |
[user] | |
name = John Q. Developer | |
email = [email protected] | |
[alias] | |
l = log --pretty=oneline -n 20 --graph --abbrev-commit | |
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f" | |
branches = branch -a |
GIT_AUTHOR_NAME="Your Name" | |
GIT_AUTHOR_EMAIL="[email protected]" | |
# if there is no username set, set it now | |
if ! git config --list | grep -q "user.name"; then | |
git config --file ~/.gitconfig_private user.name "$GIT_AUTHOR_NAME" | |
fi | |
# if there is no user email set, set it now | |
if ! git config --list | grep -q "user.email"; then |
I hereby claim:
To claim this, I am signing this object:
$ sudo apt-get update
$ sudo apt-get install python3 python3-pip
--- | |
################ | |
# Build & Test # | |
################ | |
kind: pipeline | |
name: run_tests | |
steps: | |
# Run tests against React client app (with Jest) |
version: '3.7' | |
services: | |
drone-server: | |
container_name: drone_server | |
image: drone/drone:1 | |
ports: | |
- 8080:80 | |
volumes: | |
- /var/lib/drone:/data |
This setup does not require the "Flask snippet #35" solution that is most often given for flask-restplus answers to this question.
Using the "snippet 35" solution means that the "Try it!" commands from the SwaggerUI display the wrong endpoint, which adds confusion to others looking at your documentation.
####### | |
# One # | |
####### | |
import re | |
def longest_prefix(str_list): | |
sorted_strs = sorted(str_list, key=lambda x: len(x)) | |
longest = sorted_strs[-1] |