Skip to content

Instantly share code, notes, and snippets.

@gladiopeace
gladiopeace / main.py
Created October 13, 2023 10:17 — forked from disler/main.py
vueGPT: Automatically Generate Vue 3 <script setup lang='ts'> components like a boss.
from vueGPT import prompt, make_client
from dotenv import load_dotenv
# load .env file
load_dotenv()
# get openai api key
OPENAI_API_KEY = environ.get('OPENAI_API_KEY')
# once you have an app created and downloaded:
curl -sSL https://get.wasp-lang.dev/installer.sh | sh
cd {app_folder}
# to install NVM:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
nvm install 18
nvm use 18
wasp db migrate-dev
wasp start
@gladiopeace
gladiopeace / pmxcfs.py
Created July 24, 2023 20:42 — forked from samicrusader/pmxcfs.py
Proxmox Virtual Environment config.db dump utility
#!/usr/bin/env python3
import os
import sqlite3
import sys
try:
os.mkdir('config_restore')
except:
pass
@gladiopeace
gladiopeace / llama2-mac-gpu.sh
Created July 23, 2023 14:39 — forked from adrienbrault/llama2-mac-gpu.sh
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
wget "https://huggingface.co/TheBloke/Llama-2-13B-chat-GGML/resolve/main/${MODEL}"
// Name: Midjourney Prompt
// Description: Generate a Random Midjourney Prompt
// Author: John Lindquist
// Twitter: @johnlindquist
import "@johnlindquist/kit"
let count = parseInt(
await arg({
placeholder: "How many prompts to generate and paste?",
// Name: Midjourney Imagine
// Description: Generate a random Midjourney Prompt
// Author: John Lindquist
// Twitter: @johnlindquist
import "@johnlindquist/kit"
let count = parseInt(
await arg({
placeholder: "How many prompts to generate and paste?",
@gladiopeace
gladiopeace / checker.py
Created June 13, 2023 16:32 — forked from mberman84/checker.py
Cuda Checker
import torch
print(torch.version.cuda)
print(torch.cuda.is_available())
@gladiopeace
gladiopeace / select-grid.js
Created May 27, 2023 04:03 — forked from fofr/select-grid.js
Photoshop grid selection
// Get a reference to the active document.
var doc = app.activeDocument;
// Set the height of the selection to the height of the document.
var height = doc.height;
// Set the x and y offset in pixels.
var xOffset = 5;
var yOffset = 5;
@gladiopeace
gladiopeace / restricted.m
Created May 24, 2023 20:37 — forked from aemmitt-ns/restricted.m
program to dump out forbidden classes and selectors in NSPredicates
// dump classes and selectors forbidden in NSPredicates
// `cc -framework Foundation -o restricted restricted.m`
#import <Foundation/Foundation.h>
#import <dlfcn.h>
int main() {
void *cf = dlopen("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation", 0);
NSDictionary* (*RestrictedClasses)() = dlsym(cf, "_CFPredicatePolicyRestrictedClasses");
NSDictionary* (*RestrictedSelectors)() = dlsym(cf, "_CFPredicatePolicyRestrictedSelectors");
NSLog(@"Restricted Selectors: %@", RestrictedSelectors());