I love GThumb, listed here are a couple scripts I use with GThumb.
const crypto = require("crypto"); | |
const https = require("https"); | |
const http = require("http"); | |
const url = require("url"); | |
// S256 is more secure, but if you have trouble making it work, use "plain" instead. | |
let METHOD = "S256"; | |
// let METHOD = "plain"; | |
// Generates a PKCE code verifier |
These instructions are based on DreamBooth usage with the https://github.com/ShivamShrirao/diffusers repo.
Below are 2 files. "convertToCkpt.py" and "toCkpt.sh". Create those files inside the examples/dreambooth
folder with the code provided.
#@title 🌌 Run to start dreaming.{ vertical-output: true, display-mode: "form" } | |
import IPython | |
import base64 | |
from io import BytesIO | |
all_images = [] | |
# Clear sample output | |
!rm /content/stable-diffusion/outputs/txt2img-samples/samples/* |
// To convert an axios.get that uses "ArrayBuffer" to a got request use the following: | |
// Axios (before) | |
const fileData = (await axios.get('file-url-here', { | |
responseType: 'arraybuffer' | |
})).data | |
// Got (after) | |
const fileData = await got.get('file-url-here', { | |
responseType: 'buffer' |
2024 Edit - In the comments, there are good alternatives. When this gist was written, there were few alternatives to the Slack Bolt package.
Some gotchas from my recent experience of building a serverless Next.JS + Bolt.JS Slack App on Vercel.
Note that if you're building an app that you want to distribute to other workspaces, AFAIK you need to build an API. So, Next.JS is used here to help with the public API. The alternative to an API is using "socket mode".
- When building out the API, Bolt ONLY uses the /slack/events endpoint. The Slack config settings will suggest you provide a different endpoint, like /slack/commands for Slash Commands. That would work if you weren't using the Node API (via Bolt), such as the Python API. However, Bolt uses the Node API which ONLY uses /slack/events for everything. You can still use Bolt functions
app.command()
and similar, just remember to put the/slack/events
endpoint in the Slack config.
I hereby claim:
- I am christopher-hayes on github.
- I am chris_hayes (https://keybase.io/chris_hayes) on keybase.
- I have a public key ASA3HC91wZ7aUMNgzBx2H_DjkxX0B2FMy5NkAu88DsdlQAo
To claim this, I am signing this object:
// Parse <a> tag into the link and the text | |
function parseLink(str) { | |
var m = str.match(/<a\s+href="([^"]+)"[^>]*>([^<]+)<\/a>/i); | |
if (m) { | |
return { | |
href: m[1], | |
text: m[2] | |
}; | |
} | |
return null; |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style> | |
* { margin: 0; padding: 0; } | |
html, body { text-align: center; overflow: hidden; background-color: black; } | |
#video { height: 100vh;width: auto; display: inline-block; } | |
</style> |