Skip to content

Instantly share code, notes, and snippets.

@voodoohop
voodoohop / chatgpt_commit_messages.sh
Last active May 19, 2024 09:25
One-Liner Using ChatGPT for Concise, Automated Git Commit Messages
# install
pip install shell-gpt
sgpt "hi" (and enter your API key)
# commit the current folder with the generated message
git commit . -m "$(git diff | sgpt --model gpt-4o --code 'Write concise, informative commit messages: Start with a summary in imperative mood, explain the 'why' behind changes, keep the summary under 50 characters, use bullet points for multiple changes, and reference related issues or tickets. What you write will be passed to git commit -m "[message]"')"
# you could assign an alias now if you like it
@voodoohop
voodoohop / chatgpt_image_generation.txt
Last active December 13, 2023 19:45
Allow ChatGPT to generate images using Stable Diffusion
You will now act as a prompt generator.
I will describe an image to you, and you will create a prompt that could be used for image-generation.
Once I described the image, give a 5-word summary and then include the following markdown.
![Image](https://image.pollinations.ai/prompt/{description})
where {description} is:
{sceneDetailed}%20{adjective}%20{charactersDetailed}%20{visualStyle}%20{genre}%20{artistReference}
Make sure the prompts in the URL are encoded. Don't quote the generated markdown or put any code box around it.
@voodoohop
voodoohop / render_training_video.py
Last active May 7, 2021 19:38
Creates a video from sequential training progress images. Skips more and more frames as iterations increase.
from glob import glob
# Creates a video from a folder containing images of training progress
# Allows sampling the image less often as iterations increase
# (Requires images be sortable by filename for now. Could use modification date too)
def render_video(output_path="/content/taming-transformers/output.mp4", src_path="/content/taming-transformers/", file_glob="*.png", step_increase_every=100):
tmp_path = "/tmp/latentvisions_tmp"
files = glob(src_path+file_glob)
files.sort()
@voodoohop
voodoohop / pseudo_cqt_tensorflow.py
Last active July 17, 2021 20:26 — forked from keunwoochoi/pseudo_cqt_pytorch.py
To compute pseudo CQT (Constant-Q-transform using STFT) on Tensorflow.
import librosa
import tensorflow as tf
import numpy as np
cqt_filter_fft = librosa.constantq.__cqt_filter_fft
EPS = 0.0001
class PseudoCqt():
"""A class to compute pseudo-CQT with Tensorflow.
Written by Keunwoo Choi and adapted to tensorflow by Thomas Haferlach
@voodoohop
voodoohop / workflow.sh
Created February 4, 2020 13:31 — forked from Honga1/workflow.sh
A git rebase workflow explained
# To add a change to our repository
git checkout -b "feature/feature-name" # Creates a branch called "feature/feature-name", then checks it out, locally.
git push --set-upstream origin feature/feature-name # Publish the branch on GitHub
# Make changes to your files
git add FILENAME(S) # Adds your files to "Tracked".
git status # See your "Tracked and Untracked files (green and red respectively"
@voodoohop
voodoohop / immutableProxyObject
Created December 14, 2014 16:37
Lazy Immutable Object using ES6 Proxies to create a "Virtual Object"
var _ = require("lodash");
require('harmony-reflect');
const nothing = {};
const deleteMe= {DELETED:true};
var immutableTom = function(initial) {
var wrapNewProps = (target, newProps) => {