Skip to content

Instantly share code, notes, and snippets.

View endolith's full-sized avatar
🤨

endolith

🤨
View GitHub Profile
@endolith
endolith / tmpprefs.txt
Created April 14, 2014 14:13
tmp prefs
tabmixplus
browser.link.open_newwindow=3
browser.link.open_newwindow.override.external=-1
browser.link.open_newwindow.restriction=0
extensions.tabmix.linkTarget=true
extensions.tabmix.enablefiletype=true
extensions.tabmix.opentabforLinks=0
extensions.tabmix.singleWindow=false
extensions.tabmix.loadOnNewTab.type=4
browser.newtab.url=about:blank

Convert screenshots of text into actual text.

OCR script for greenshot. Creates a text file on the desktop with the OCRed text. Use the External command Plugin to call tesseract_greenshot.bat, with "{0}" as the argument.

Requires greenshot, tesseract, imagemagick, and python to be installed. This could definitely be less cobbled-together, but it works so who cares. Also there might be a real plugin later? Make sure tesseract and python are in PATH environment variable and "Add application directory to your system path" is checked while installing Imagemagick.

@endolith
endolith / pairing.py
Created November 19, 2014 04:32
pole and zero pairing attempt
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 13 21:36:42 2014
"""
from __future__ import division, print_function
import numpy as np
from numpy import zeros, abs, argmin, conj, argsort, concatenate, delete
@endolith
endolith / readme.md
Last active August 29, 2015 14:18
Resonant sine Teensy Audio

Distortion is 95 dB THD or so, has fewer frequency components than linear-interpolated LUT, but overall THD level is similar.

Can only go up to fs/6, though, because signed a can only go to Q31 1.0, not 2.0.

Found in http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.84.1650 but didn't work until I combined with http://www.musicdsp.org/showArchiveComment.php?ArchiveID=10

This is even faster, but distorted at low levels: https://gist.github.com/endolith/14bbb3217f9f58248722

Crude timing results (Should have measured with many instances in parallel instead):

@endolith
endolith / resonant.cpp
Created May 1, 2015 02:26
fast resonant sine but distorted
#include "resonant.h"
#include "utility/dspinst.h"
void AudioSynthWaveformRes::update(void)
{
audio_block_t *block;
uint32_t i;
if (c or s)
{
@endolith
endolith / quadratic.cpp
Last active August 29, 2015 14:20
Quadratic approximation of sine
#include "quadratic.h"
#include "utility/dspinst.h"
void AudioSynthWaveformRes::update(void)
{
audio_block_t *block;
uint32_t i, inc;
int32_t ph, modph;
int32_t y, tmp;
uint32_t quadrant;
@endolith
endolith / -Readme.txt
Created February 27, 2009 17:22
Ubiquity commands
// -----------------------------------------------------------------
// Description page for these Ubiquity commands: http://www.endolith.com/ubiquity_commands.html
// -----------------------------------------------------------------
// I guess only one link rel="commands" works per page, so for now, at least, all commands are in one gist, separated into files based on subject.
// Some of these ain't workin since 0.5. Need to fix them.
// For http://www.jslint.com/ :
/*global CmdUtils, Utils, context, displayMessage, noun_arb_text, noun_type_url, _*/
@endolith
endolith / Readme.txt
Created March 4, 2009 21:28
This is a gist experiment
I'm not really sure how to work with this site or divide up gists yet...
Only one link rel="commands" works per page, so for now, at least, I need to keep them all in one gist:
http://gist.github.com/gists/71580
and then include them from another site?
http://www.endolith.com/ubiquity_commands.html
@endolith
endolith / commands.sh
Created March 13, 2009 14:17
fish bash cheatsheet
# I hate the command line.
# I use fish as my default shell http://www.fishshell.org/
# List disk usage of each subdirectory
du -s --si *
# Access one computer from the other, regardless of whether Internet is down, Dynamic DNS is down, Wireless is down, or computer is outside of LAN
# Tomato assigns different hostnames to different MAC addresses, regardless of which computer it is, so I have a separate _wired hostname
function desktop --description 'Connect to desktop machine through SSH'
@endolith
endolith / mouse_movement_tester.pde
Created May 16, 2009 23:02
Processing sketch to show your mouse's movement
// Processing sketch to show your mouse's movement
// Linux's mouse acceleration really sucks.
void setup() {
size(800, 800);
background(0);
}
void draw(){
if (mousePressed == true) {