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 typing as t | |
import click | |
def deco(f): | |
f = click.option("--foo")(f) | |
f = click.option("--bar", type=int)(f) | |
return f |
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
#!/usr/bin/env python3 | |
""" | |
Intentionally trigger rate limiting within Globus Search. | |
This script runs a request loop, up to a maximum of N, until a rate limiting | |
error is reached. If given an access token, it will make authenticated calls. | |
Without an access token, it makes unauthenticated calls. | |
""" | |
import argparse | |
import 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
#!/usr/bin/env python3 | |
import sys | |
import globus_sdk | |
CLIENT_ID = "5f50cf96-04f9-4223-97f7-7d288d132b34" | |
UUIDLEN = len(CLIENT_ID) | |
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
#!/usr/bin/env python3 | |
""" | |
Copy all of the Access Control Lists from one Globus Endpoint to another, by | |
means of the globus-cli | |
This will not remove any ACLs from either endpoints and it will not stop to | |
check for duplicates | |
""" | |
import argparse | |
import 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
#!/bin/bash | |
# substitute your own Endpoint ID here | |
EP_ID="SET ME" | |
# use text output, and scrape the header off with tail | |
# grep -v "^NULL" removes rules with no ID -- these are cases where a | |
# permission is granted via a role (e.g. administrator), not an ACL rule we | |
# could recreate |
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
/* | |
* A simple example of a Client Credentials Grant against Globus Auth | |
*/ | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.OutputStream; | |
import javax.net.ssl.HttpsURLConnection; | |
import java.net.URL; |
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
""" | |
Parse and display Server-Timing header info | |
""" | |
import shutil | |
def timing_string_to_dict(server_timing_string): | |
""" | |
Given a Server Timing value as a string, parse it into a dict of the format |
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
[ | |
"#cc241d", | |
"#98971a", | |
"#d79921", | |
"#458588", | |
"#b16286", | |
"#689d6a", | |
"#7c6f64", | |
"#928374", | |
"#9d0006", |
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
" ALE conf | |
let g:ale_fixers = { | |
\ '*': [], | |
\ 'python': ['isort', 'black'], | |
\} | |
let g:airline#extensions#ale#enabled = 1 | |
" if a '.__py_autoformat' file is in the cwd or a parent of the cwd, enable ALE fix_on_save and tune for black | |
augroup py_ft | |
au! |
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
$ python test.py | |
in dummy_transaction pre-yield | |
going critical | |
in dummy_transaction except clause |
NewerOlder