Skip to content

Instantly share code, notes, and snippets.

View pplantinga's full-sized avatar
:octocat:
Awesome

Peter Plantinga pplantinga

:octocat:
Awesome
View GitHub Profile
@pplantinga
pplantinga / telephone_diffusion.py
Created November 18, 2022 19:33
Simple UI to play Telephone Diffusion
import torch, sys, argparse, os
import tkinter as tk
from diffusers import StableDiffusionPipeline
MAXLEN=4
# Parse the name of the game folder
p = argparse.ArgumentParser()
p.add_argument("game_name")
args = p.parse_args()
@pplantinga
pplantinga / convert_model.py
Created April 27, 2021 18:05
Convert the names of model parameters
import torch
import argparse
import speechbrain as sb
from collections import OrderedDict
from hyperpyyaml import load_hyperpyyaml
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--hparams", required=True)
parser.add_argument("--hparams_key", required=True)
alias please="sudo"
@pplantinga
pplantinga / .vimrc
Last active December 18, 2015 09:29
My default .vimrc
" Peter's .vimrc, borrowing heavily from
" http://vim.wikia.com/wiki/Example_vimrc
" Set 'nocompatible' to ward off unexpected things that your distro might
" have made, as well as sanely reset options when re-sourcing .vimrc
set nocompatible
" Attempt to determine the type of a file based on its name and possibly its
" contents. Use this to allow intelligent auto-indenting for each filetype,
" and for plugins that are filetype specific.
@pplantinga
pplantinga / form-progress.html
Last active December 18, 2015 04:09 — forked from chriscoyier/index.html
Example progress element usage, from Chris Coyer. This example actually works without editing.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" type="text/javascript"></script>
<script src="script.js" type="text/javascript"></script>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<form accept-charset="UTF-8" action="#" class="pro-form" id="pro-form" method="post">
@pplantinga
pplantinga / alarm.sh
Created May 23, 2013 21:02
Want to set an alarm via OS X terminal? It's easy, just use this!
#!/bin/bash
# Simple script for setting an alarm on Mac OS X
# Arguments are ./alarm.sh {hour} {minute}
until [ `date "+%H"` -eq $1 ] && [ `date "+%M"` -eq $2 ]; do
sleep 10
done
osascript -e 'set volume 7'
@pplantinga
pplantinga / madness.sh
Created May 23, 2013 20:51
A beautiful little script by my friend Brad Greco. It is awesome.
#!/bin/bash
# This program prints "This is madness!" in many colors. It is awesome.
# Author: Brad Greco
# Author URL: http://bgreco.net
j=1;
add=1;
for ((k=1; k<1000; k++)) do
for ((i=30; i<38; i++)) do