Skip to content

Instantly share code, notes, and snippets.

View Christopher-Hayes's full-sized avatar
🇺🇦
stand-with-ukraine.pp.ua

Chris​‌​‮ ‬Hayes‌​​​ Christopher-Hayes

🇺🇦
stand-with-ukraine.pp.ua
View GitHub Profile
@Christopher-Hayes
Christopher-Hayes / _gthumb-scripts.md
Last active October 23, 2022 10:31
GThumb Scripts

GThumb Scripts

I love GThumb, listed here are a couple scripts I use with GThumb.

@Christopher-Hayes
Christopher-Hayes / convertToCheckpoint.md
Last active February 10, 2024 14:53
Convert DreamBooth .bin files to a .ckpt file

Converting DreamBooth .bin files to a .ckpt model file.

These instructions are based on DreamBooth usage with the https://github.com/ShivamShrirao/diffusers repo.

1. Add the script files

Below are 2 files. "convertToCkpt.py" and "toCkpt.sh". Create those files inside the examples/dreambooth folder with the code provided.

1a. Python convert script (required)

@Christopher-Hayes
Christopher-Hayes / sb-output-grid.py
Last active September 8, 2022 00:32
Output Grid Code Block for Stable Diffusion Colab
#@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/*
@Christopher-Hayes
Christopher-Hayes / got-arraybuffer.js
Last active August 12, 2022 15:23
Converting an axios.get arraybuffer request to a Got.get()
// 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'
@Christopher-Hayes
Christopher-Hayes / slack-bolt.md
Last active February 16, 2024 18:37
Building a Serverless SlackBot with Bolt on Vercel - Things to Know

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".

Slack API with Bolt must use /slack/events endpoint

  • 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.

Serverless is not supported with Bolt

Keybase proof

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:

@Christopher-Hayes
Christopher-Hayes / newRelicNuxt.md
Last active March 30, 2024 06:14
Using the NewRelic agent with Nuxt

Install the Agent

npm i newrelic


Add the newrelic.js file to the root

This file is downloaded from the New Relic node.js set up process.

@Christopher-Hayes
Christopher-Hayes / downloadLinks.js
Last active October 19, 2021 17:30
All Copilot - Download images from a list of <a> links
@Christopher-Hayes
Christopher-Hayes / previewCamera.html
Created July 31, 2021 05:25
Preview Camera before Joining a Call
<!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>
@Christopher-Hayes
Christopher-Hayes / hideGlassDoorHardsell.js
Created July 17, 2021 20:38
Hide GlassDoor Hardsell Popup - ViolentMonkey Script
// ==UserScript==
// @name Hide hardsell - glassdoor.com
// @namespace Violentmonkey Scripts
// @match https://www.glassdoor.com/*
// @version 1.0
// @author @christopher-hayes
// @description Hide the hardsell popup on Glassdoor
// ==/UserScript==
function killHardSell() {
document.body.style.height = 'unset';