Skip to content

Instantly share code, notes, and snippets.

def mkDelay(in: GE, buf: GE): GE = {
val dt = BufDur.kr(buf)
DelayN.ar(in, dt, dt)
}
// returns (delayed source, shift90)
def HilbertFIR(in: GE, buf: GE): (GE, GE) = {
val fft = FFT(buf, in)
val pv = PV_PhaseShift90(fft)
val dly = mkDelay(in, buf)
// ==UserScript==
// @name startpage/ixquick remove ads
// @namespace startpage.com
// @description Removes ads from startpage/ixquick before they are displayed.
// @include https://startpage.com/*
// @include https://*.startpage.com/*
// @include https://ixquick.com/*
// @include https://*.ixquick.com/*
// @run-at document-end
// @grant none
#!/bin/sh
for file in *.java; do
mv "$file" "${file%.java}.win.txt"
iconv -f windows-1250 -t utf-8 "${file%.java}.win.txt" -o "${file%.java}.java"
rm "${file%.java}.win.txt"
done
import scala.concurrent.{Future, ExecutionContext}
import de.sciss.processor._
def mkFuzzy(in: File, out: File, side: Float = -12.dbamp): Processor[Unit] = {
require(!out.exists)
import ExecutionContext.Implicits.global
val afIn = io.AudioFile.openRead(in)
val afOut = io.AudioFile.openWrite(out, afIn.spec)
val res = Processor[Unit]("fuzzy") { self =>
val bufIn = afIn .buffer(8192)
@Sciss
Sciss / about:config.md
Last active September 14, 2015 23:22 — forked from haasn/about:config.md
Firefox bullshit removal via about:config

Firefox bullshit removal

Due to the incessant swarm of complete and utter nonsense that has been forcing its way into Firefox over time, I've decided to start collecting my personal list of “must-have” about:config tweaks required to turn Firefox into a functional brower.

WebSockets

These can be used for nefarious purposes and to bypass access restrictions.

network.websocket.enabled=false
play {
RandSeed.ir(trig = 1, seed = 123.0)
val in_0 = LeakDC.ar(119.41751, coeff = 0.995)
val lPF_0 = LPF.ar(in_0, freq = 10.0)
val henonC = HenonC.ar(freq = 0.00926502, a = Seq(17.394705, 17.395),
b = 1.6281785, x0 = 0.0, x1 = 0.054798387)
val in_1 = LeakDC.ar(119.41751, coeff = 0.995)
val delayC = DelayC.ar(in_1, maxDelayTime = 0.00926502, delayTime = 0.0034992173)
val in_2 = LeakDC.ar(119.41751, coeff = 0.995)
val onePole = OnePole.ar(in_2, coeff = 0.999)
val buf = Buffer.alloc(s, 32768, 2)
buf.write((userHome / "Music" / "MyHeart_199_iter1_no475s.aif").path, numFrames = 0, leaveOpen = true)
val rec = play(addAction = addToTail) {
DiskOut.ar(buf.id, In.ar(0, 2))
()
}
// ...
import scala.concurrent.{blocking, Future, ExecutionContext}
def trim(path: String): Future[Unit] = {
import ExecutionContext.Implicits.global
val in = file(path)
val out = in.parent / s"${in.base}-trim.${in.ext}"
val res = if (out.exists) {
Future.failed(new Exception(s"Output file $out already exists. Not overwriting!"))
} else Future {
import sys.process._
def maxSize(dir: File): (Int, Int) = {
val xs = dir.children(_.ext.toLowerCase == "png")
((0, 0) /: xs) { case ((w, h), x) =>
val txt = Seq("identify", x.path).!!
val words = txt.split(" ")
require(words(1) == "PNG")
val sub = words(2)
val j = sub.indexOf('x')
def compareName(s1: String, s2: String): Int = {
val n1 = s1.length
val n2 = s2.length
val min = math.min(n1, n2)
var i = 0; while (i < min) {
var c1 = s1.charAt(i)
var c2 = s2.charAt(i)
var d1 = Character.isDigit(c1)
var d2 = Character.isDigit(c2)
if (d1 && d2) {