Skip to content

Instantly share code, notes, and snippets.

View johndpope's full-sized avatar

John D. Pope johndpope

View GitHub Profile
@johndpope
johndpope / apfs-fuse-install.sh
Created November 27, 2023 23:39 — forked from romdim/apfs-fuse-install.sh
Install apfs-fuse in Ubuntu 20.04 LTS
sudo apt update
sudo apt install fuse libfuse-dev libicu-dev bzip2 libbz2-dev cmake git libattr1-dev zlib1g-dev g++
sudo snap install cmake --classic
git clone https://github.com/sgan81/apfs-fuse.git
cd apfs-fuse
git submodule init
git submodule update
mkdir build
@johndpope
johndpope / lemur.py
Created August 2, 2023 23:46 — forked from svpino/lemur.py
import os
import assemblyai as aai
from pytube import YouTube
aai.settings.api_key = "INSERT YOUR API KEY HERE"
youtube_url = "https://www.youtube.com/watch?v=f94wKh70cOY"
# Let's download the YouTube video
youtube = YouTube(youtube_url)
audio = youtube.streams.filter(only_audio=True).first()
@johndpope
johndpope / supabase_api_auth.sql
Created August 18, 2022 00:28 — forked from FelixZY/supabase_api_auth.sql
How to configure Supabase (https://supabase.com/) to generate and accept API tokens.
-- Token Based API Access for Supabase
--
-- How to configure Supabase (https://supabase.com/) to generate and accept API tokens.
--
-- (c) 2022 Felix Zedén Yverås
-- Provided under the MIT license (https://spdx.org/licenses/MIT.html)
--
-- Disclaimer: This file is formatted using pg_format. I'm not happy with the result but
-- prefer to follow a tool over going by personal taste.
--
@johndpope
johndpope / install.sh
Created October 14, 2021 04:49 — forked from aaabramov/install.sh
Installing zsh + oh-my-zsh on Amazon EC2 Amazon Linux 2 AMI
sudo yum update
# Installing ZSH
sudo yum -y install zsh
# Check ZSH has been installed
zsh --version
# Install "util-linux-user" because "chsh" is not available by default
# See https://superuser.com/a/1389273/599050
# weechat script to display image in terminal
# (tested in termite, which is based on vte-ng)
# requirements:
# * weechat (of course)
# * w3m (for w3mimgdisplay)
# * imlib2-webp (optional, for webp support)
#
# save this script as ~/.weechat/python/test.py and load using
# /python load test.py
# in weechat.
@johndpope
johndpope / zooming-vqgan-clip-z-quantize-method-with-additions.ipynb
Created July 31, 2021 04:09 — forked from chigozienri/notebook.ipynb
Zooming VQGAN+CLIP (z+quantize method with additions).ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@johndpope
johndpope / killer.sh
Created July 25, 2021 04:41 — forked from ride90/killer.sh
Process killer by name
#!/usr/bin/env bash
# Author: Oleh Pshenychnyi
# Date: 13.02.2021
#
# Kill all processes matching a provided pattern.
#
# Usage:
#
# >> bash killer.sh celery
@johndpope
johndpope / LinuxCUDAtoolkits.md
Last active July 4, 2021 20:31 — forked from khansun/LinuxCUDAtoolkits.md
Multiple versions of CUDA toolkit and CUDNN installation guide for Linux

Remove previous NVIDIA drivers if needed:

sudo dpkg -P $(dpkg -l | grep nvidia-driver | awk '{print $2}')

sudo apt autoremove

sudo lshw -C display

NVIDIA Apmere cards including 3070, 3080 and 3090 dos not work with CUDA 10.
@johndpope
johndpope / GenerateFirebasePushID.SQL
Created November 14, 2020 10:29 — forked from DimuDesigns/GenerateFirebasePushID.SQL
MySQL Stored Procedure for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@johndpope
johndpope / PushIDGenerator.swift
Created October 23, 2020 19:57 — forked from AhmedOS/PushIDGenerator.swift
Swift 4 port of Firebase Push ID generator
// original: https://gist.github.com/mikelehen/3596a30bd69384624c11
class PushIDGenerator {
private init() { }
static private let PUSH_CHARS = Array("-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz")
static private var lastPushTime: UInt64 = 0
static private var lastRandChars = Array<Int>(repeating: 0, count: 12)
static func generate() -> String {