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
type JSONValue = | |
| string | |
| number | |
| boolean | |
| { [x: string]: JSONValue } | |
| Array<JSONValue>; | |
/** | |
* A CloudWatch Logs type. | |
*/ |
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
from fire import Fire | |
import torch | |
from transformers import pipeline | |
def main(): | |
generate_text = pipeline( | |
model="nomic-ai/gpt4all-j", | |
revision="v1.2-jazzy", | |
torch_dtype=torch.bfloat16, |
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
# Allows executing `watch` on an alias. Source: https://unix.stackexchange.com/a/25329 | |
alias watch="watch " | |
# GIT | |
alias gl="git log --oneline" | |
alias gri="git rebase --interactive" | |
alias gpfo='git push --force-with-lease origin $(git branch --show-current)' | |
alias gcm="git checkout master" | |
alias grm="git rebase master" |
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 axios from "axios"; | |
const uploadFile = async ( | |
file: File, | |
signedUrl: string | |
): Promise<void> => { | |
await axios.put(signedUrl.replace(/"/g, ""), file, { | |
headers: { | |
"Content-Type": "application/octet-stream", | |
"X-Goog-Content-Length-Range": "1,1000000" |
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
from typing import Optional | |
from datetime import timedelta | |
from google import auth | |
from google.auth.transport import requests | |
from google.cloud.storage import Client | |
def make_signed_upload_url( | |
bucket: str, |
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
resource "google_storage_bucket_iam_member" "bucket_admin" { | |
bucket = google_storage_bucket.my_bucket.name | |
role = "roles/storage.admin" # this includes the `roles/storage.objectCreator` role | |
member = "serviceAccount:${google_service_account.my_service_account.email}" | |
} | |
resource "google_project_iam_member" "token_creator" { | |
project = "my-gcp-project" | |
role = "roles/iam.serviceAccountTokenCreator" | |
member = "serviceAccount:${google_service_account.my_service_account.email}" |
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
resource "google_storage_bucket" "my_bucket" { | |
name = "my-unique-bucket-name" | |
cors { | |
origin = ["*"] | |
method = ["*"] | |
response_header = [ | |
"Content-Type", | |
"Access-Control-Allow-Origin", | |
"X-Goog-Content-Length-Range" | |
] |
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
""" | |
Error-handling middleware for the docker-compose CLI. Greps through the stdout of a docker-compose command, | |
finding the highest exit code produced by any services that exited prematurely. After docker-compose | |
exits, prints the message associated with that highest code then exits with that code. Useful | |
when you want to exit with an error code if *any* of your containers fail, and not just if the one | |
specified by `--exit-code-from` fails. | |
Example usage: | |
``` |
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
# ENVIRONMENT | |
############# | |
cd ~ | |
mkdir code | |
mkdir code/sandbox | |
# Make desktop environment clock be AM/PM instead of 24h. | |
gsettings set org.gnome.desktop.interface clock-format '12h' | |
# DEVELOPER ESSENTIALS |
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
# Register the Ubuntu Nvidia PPA | |
add-apt-repository ppa:graphics-driver/ppa | |
apt update | |
ubuntu-drivers autoinstall | |
# Restart the machine | |
reboot | |
# Then, once rebooted... | |
# Install the latest toolkit |
NewerOlder