This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command
$ docker-compose up -d
# To Tear Down
$ docker-compose down --volumes
@font-face { | |
font-family: SegoeUI; | |
src: | |
local("Segoe UI Light"), | |
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff2) format("woff2"), | |
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff) format("woff"), | |
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.ttf) format("truetype"); | |
font-weight: 100; | |
} |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> | |
<link rel="stylesheet" href="style.css" /> | |
<script src="response.js" async defer></script> | |
<title>Custom Response</title> | |
</head> |
# I'll be doing another one for Linux, but this one will give you | |
# a pop up notification and sound alert (using the built-in sounds for macOS) | |
# Requires https://github.com/caarlos0/timer to be installed | |
# Mac setup for pomo | |
alias work="timer 60m && terminal-notifier -message 'Pomodoro'\ | |
-title 'Work Timer is up! Take a Break 😊'\ | |
-appIcon '~/Pictures/pumpkin.png'\ | |
-sound Crystal" |
# study stream aliases | |
# Requires https://github.com/caarlos0/timer to be installed. spd-say should ship with your distro | |
declare -A pomo_options | |
pomo_options["work"]="45" | |
pomo_options["break"]="10" | |
pomodoro () { | |
if [ -n "$1" -a -n "${pomo_options["$1"]}" ]; then | |
val=$1 |
async function readRequestBody(request) { | |
const { headers } = request; | |
const contentType = headers.get('content-type') || ''; | |
if (contentType.includes('application/json')) { | |
return JSON.stringify(await request.json()); | |
} else if (contentType.includes('form')) { | |
const formData = await request.formData(); | |
const body = {}; | |
for (const entry of formData.entries()) { | |
body[entry[0]] = entry[1]; |
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:
/** | |
* 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,