Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
| addEventListener("fetch", event => { | |
| event.respondWith(handleRequest(event.request)) | |
| }) | |
| let body = {}; | |
| async function handleRequest(request) { | |
| let content = "just drop if it fails...okay ?"; | |
| for( var i of request.headers.entries() ) { | |
| content += i[0] + ": " + i[1] + "\n"; | |
| } | |
| let respContent = ""; |
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
| section.e-flex.e-hvh.e-wvw | |
| .marquee.e-abs | |
| - var text = 'this is a repeated text lorem ipsum' | |
| h1.mq.t-color(data-text=""+text)=text | |
| video(autoplay="" loop="" muted="" playsinline="") | |
| // | |
| support to Safari | |
| source(src="https://raw.githubusercontent.com/Efetivos/gallery/master/avulsos/VWLAB_LOGO_1.mov" type="video/quicktime") |
Using CSS mask to create a fading content inside border
alternative version without mask-composite: https://codepen.io/t_afif/pen/YzObqzg
| /** | |
| * Get a Google auth token given service user credentials. This function | |
| * is a very slightly modified version of the one found at | |
| * https://community.cloudflare.com/t/example-google-oauth-2-0-for-service-accounts-using-cf-worker/258220 | |
| * | |
| * @param {string} user the service user identity, typically of the | |
| * form [user]@[project].iam.gserviceaccount.com | |
| * @param {string} key the private key corresponding to user | |
| * @param {string} scope the scopes to request for this token, a | |
| * listing of available scopes is provided at |
Use your service account's key JSON file to get an access token to call Google APIs.
Good for seeing how things work, including the creation of JWT token.
To create a JWT token, you can replace create-jwt-token.sh script with tools like step.
If you just want to get an access token for a service account,
| # must have conda installed | |
| git clone https://github.com/joonspk-research/generative_agents.git | |
| cd generative_agents | |
| # open visual studio code, open gen agents folder | |
| # within vscode, go to reverie/backend_server | |
| # create new file utils.py | |
| # copy/paste contents from github (below) | |
| ### | |
| # Copy and paste your OpenAI API Key |
| """ | |
| This script combines two datasets to generate a file with all found patterns. | |
| """ | |
| import srsly | |
| from prodigy.components.db import connect | |
| import spacy | |
| nlp = spacy.blank("en") |
| """ | |
| This script combines two datasets to generate a file with all found patterns. | |
| """ | |
| import srsly | |
| from prodigy.components.db import connect | |
| import spacy | |
| nlp = spacy.blank("en") |
| from datasets import load_dataset | |
| from sentence_transformers.losses import CosineSimilarityLoss | |
| from setfit import SetFitModel, SetFitTrainer | |
| dataset = load_dataset("yelp_polarity") | |
| print(dataset) | |
| # Select N examples per class (8 in this case) | |
| train_ds = dataset["train"].shuffle(seed=42).select(range(8 * 2)) |