Skip to content

Instantly share code, notes, and snippets.

View imWildCat's full-sized avatar

Mike Chong imWildCat

  • Canada
  • 21:19 (UTC -06:00)
View GitHub Profile
from langchain.llms.base import LLM
from typing import Optional, List
from revChatGPT.V1 import Chatbot
class revChatGPT(LLM):
chatbot: Chatbot = Chatbot(config={
"access_token": "<your token here>"
})
@imWildCat
imWildCat / repo-rinse.sh
Created August 3, 2023 22:55 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@imWildCat
imWildCat / QuickXorHash.rs
Created May 18, 2022 02:50 — forked from gzxu/QuickXorHash.rs
Implementing the QuickXorHash Algorithm used by the Microsoft Graph API on OneDrive for Business
use std::env;
use std::fs;
// extern crate base64;
// From the specification
// https://docs.microsoft.com/en-us/onedrive/developer/code-snippets/quickxorhash
// According to the spec, the block is "big-endian"
type Block = [u8; 20]; // Intrinsically with Copy trait
@imWildCat
imWildCat / Catalyst-ScaleFactor.swift
Created July 28, 2020 15:20 — forked from mhdhejazi/Catalyst-ScaleFactor.swift
Change the window scale factor in a Mac Catalyst app with the help of Dynamic (https://github.com/mhdhejazi/Dynamic)
override func viewDidAppear(_ animated: Bool) {
view.window?.scaleFactor = 1.0 // Default value is 0.77
}
extension UIWindow {
var scaleFactor: CGFloat {
get {
Dynamic.NSApplication.sharedApplication
.windows.firstObject.contentView
.subviews.firstObject.scaleFactor ?? 1.0
@imWildCat
imWildCat / install-postgres-10-ubuntu.md
Last active August 23, 2018 17:32 — forked from alistairewj/install-postgres-10-ubuntu.md
Install PostgreSQL 10 on Ubuntu

Install PostgreSQL 10 on Ubuntu

This is a quick guide to install PostgreSQL 10 - tested on Ubuntu 16.04 but likely can be used for Ubuntu 14.04 and 17.04 as well, with one minor modification detailed below.

(Important) After installation: Common issues

  1. Getting error: Peer authentication failed for user “postgres”, when trying to get pgsql working with rails: https://stackoverflow.com/questions/18664074/getting-error-peer-authentication-failed-for-user-postgres-when-trying-to-ge
  2. PostgreSQL: role is not permitted to log in https://stackoverflow.com/questions/35254786/postgresql-role-is-not-permitted-to-log-in
  3. In order to gem install pg: apt-get install libpq-dev