Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / gist:8327328
Created January 9, 2014 00:27
gif code!!!!!
int samplesPerFrame = 32;
int numFrames = 42;
float shutterAngle = .8;
int[][] result;
float time;
float d1, d2, th, pp = .7, t, tt;
int N = 10, M = 9;
@grinsted
grinsted / drumkit_split64.py
Last active April 18, 2021 22:14
Tool for quickly making drumkits for the novation circuit
# This file contains code to save 64 samples as a syx file for Novation Circuit
#
# * It reads a single long wave file.
# * splits it into 64 equal chunks
# * crops the sound
# * adds a super fast fadein and "an appropriate fadeout". To remove clicks
# * normalizes every sample
# * Saves the whole thing as a syx file.
#
@kouk
kouk / tmxsync.sh
Last active April 6, 2023 20:52
tmux synchronize-windows
# tmxsync: bring all windows as panes into one window and activate the "synchronize-panes" option
# tmxunsync: split all panes into different windows and deactivate the "synchronize-panes" option.
# Licence:
# To the extent possible under law I, Konstantinos Koukopoulos, have waived all copyright and related or neighboring rights to tmxsync.sh, as describe by the CC0 document:
# http://creativecommons.org/publicdomain/zero/1.0/
# This work is published from: Greece.
tmxsync () {
export _TMUX_SYNC=1;
anonymous
anonymous / gist:7200880
Created October 28, 2013 17:20
Processing motion blur
/* passable motion blur effect using frame blending
* basically move your 'draw()' into 'sample()', time runs from 0 to 1
* by dave
* http://beesandbombs.tumblr.com
*/
int samplesPerFrame = 32; // more is better but slower. 32 is enough probably
int numFrames = 48;
float shutterAngle = 2.0; // this should be between 0 and 1 realistically. exaggerated for effect here
int[][] result;
anonymous
anonymous / gist:10675250
Created April 14, 2014 19:11
Motion Blur + Chromatic Aberration
// by dave @ beesandbombs.tumblr.com >:)
void setup() {
setup_();
result = new int[width*height][3];
result_ = new int[width*height][3];
}
int[][] result, result_;
float time;
@josephwecker
josephwecker / new_bashrc.sh
Created August 11, 2012 04:36
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful. Now a repo: https://github.com/josephwecker/bashrc_dispatch
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# -- DEPRICATED --
# This gist is slow and is missing .bashrc_once
# Use the one in the repo instead! https://github.com/josephwecker/bashrc_dispatch
# (Thanks gioele)
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
@Vesnica
Vesnica / average.lua
Created September 8, 2012 06:54
Embed Lua example
avg, sum = average(10, 20, 30, 40, 50)
print("The average is ", avg)
print("The sum is ", sum)
print("Versioin is ", VERSION)
@beardicus
beardicus / plotter-pen-adapter.jscad
Last active March 6, 2024 22:23
Plotter Pen Adapter for use with OpenJSCAD
// title : Plotter Pen Adapter
// author : Brian Boucheron <brian@boucheron.org>
// license : MIT License
// revision : 0.003
// date : June 9 2022
// file : plotter-pen-adapter.jscad
// gist : https://gist.github.com/beardicus/d668c0f6b96be53d16dc
// A parametric version of the plotter pen adapter found here:
// https://www.printables.com/model/156721-sharpie-fine-point-plotter-adapter
@nylki
nylki / char-rnn recipes.md
Last active March 16, 2024 15:13
char-rnn cooking recipes

do androids dream of cooking?

The following recipes are sampled from a trained neural net. You can find the repo to train your own neural net here: https://github.com/karpathy/char-rnn Thanks to Andrej Karpathy for the great code! It's really easy to setup.

The recipes I used for training the char-rnn are from a recipe collection called ffts.com And here is the actual zipped data (uncompressed ~35 MB) I used for training. The ZIP is also archived @ archive.org in case the original links becomes invalid in the future.

# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}