Skip to content

Instantly share code, notes, and snippets.

View johndpope's full-sized avatar

John D. Pope johndpope

View GitHub Profile
onverting the provided Ruby on Rails code to PostgreSQL stored procedure is not a straightforward process, and it will require a significant amount of effort to re-implement the same functionality in PostgreSQL.
Here are the general steps you can follow:
Identify the data models and relationships: You need to identify the data models and relationships used in the Rails code and translate them into PostgreSQL data structures, including tables, columns, indexes, and constraints.
Define the stored procedure parameters: You need to define the stored procedure parameters based on the input parameters used in the Rails code.
Implement the main logic: You need to implement the main logic of the Rails code in the stored procedure. This will include querying the relevant tables, filtering the data based on the input parameters, and returning the result.
@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
package app
import (
"context"
"fin-go/routes/accounts"
"fin-go/routes/analysisTrees"
"fin-go/routes/categories"
"fin-go/routes/itemTokens"
"fin-go/routes/plaidHelper"
"fin-go/routes/resetDB"
# 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.
#!/usr/bin/env python
# coding: utf-8
import os
os.chdir('/home/jp/Documents/gitWorkspace')
CODE_DIR = 'PTI'
os.chdir(f'./{CODE_DIR}')
@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.
import Foundation
import AVFoundation
import UIKit
private let userDefaultsCachePathKey = "video.cache.path"
private let userDefaultsFileSizeKey = "video.cache.size"
private let userDefaultsLastAccessedDictionaryKey = "video.cache.last.accessed.key" // Key: last accessed, value: path
private let maxConcurrentDownloads = 2