Skip to content

Instantly share code, notes, and snippets.

@pfig
pfig / mkfavicon.sh
Created February 12, 2012 12:01
Make a multi-resolution favicon.ico from a source image, using ImageMagick
#!/bin/bash
# from
# http://bergamini.org/computers/creating-favicon.ico-icon-files-with-imagemagick-convert.html
convert source-WxW.png -resize 256x256 -transparent white favicon-256.png
convert favicon-256.png -resize 16x16 favicon-16.png
convert favicon-256.png -resize 32x32 favicon-32.png
convert favicon-256.png -resize 64x64 favicon-64.png
convert favicon-256.png -resize 128x128 favicon-128.png

$argon2id$v=19$m=64,t=512,p=2$mpknJXWwj9fK1OT3EjofrA$69JwYQ1IKC8Jp/kIaNfh8w

@pfig
pfig / morphagene_ableton.py
Created March 6, 2021 19:54 — forked from knandersen/morphagene_ableton.py
Allows you to use Ableton projects and exports as reels for the Make Noise Morphagene eurorack module.
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
USAGE:
morphagene_ableton.py -w <inputwavfile> -l <inputlabels> -o <outputfile>'
Instructions in Ableton:
Insert locators as splice markers in your project (Create > Add Locator)
Export Audio/Video with
Sample Rate: 48000 Hz
@pfig
pfig / monoise.py
Last active December 14, 2020 16:22
Convert samples to mono
#!/usr/bin/env python
"""
mo' noise
monome + noise
mono-ise
"""
#
# You will need sox and pysox
# https://github.com/rabitt/pysox#install
#
@pfig
pfig / lessc.rake
Created March 25, 2012 09:09
Task to compile LESS in jekyll-bootstrap
#
# Save this in _rake/lessc.rake
#
require 'less'
LESS = File.join(SOURCE, "assets", "themes", "twitter") # set theme here
CONFIG['less'] = File.join(LESS, "less")
CONFIG['css'] = File.join(LESS, "css")
CONFIG['input'] = "style.less"
@pfig
pfig / BootTidal.hs
Last active September 4, 2019 11:09
Tidal startup errors in emacs
-- $ ghc-pkg describe $(ghc-pkg latest tidal) | grep data-dir | cut -f2 -d ' '
-- /Users/pfig/.cabal/share/x86_64-osx-ghc-8.6.5/tidal-1.4.3
-- $ cat /Users/pfig/.cabal/share/x86_64-osx-ghc-8.6.5/tidal-1.4.3/BootTidal.hs
:set -XOverloadedStrings
:set prompt ""
:set prompt-cont ""
import Sound.Tidal.Context
GHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help
Prelude>
<interactive>:3:18: error:
Variable not in scope: bpsUtils :: IO (a0, b0)
<interactive>:4:12: error:
Variable not in scope: superDirtSetters :: t0 -> IO (a0, b0)
<interactive>:4:29: error: Variable not in scope: getNow
@pfig
pfig / perl_smoker
Created May 21, 2011 21:21 — forked from melo/perl_smoker
Script to use with Jenkins to smoke a Perl module
#!/bin/sh
#
# Use this as Jenkins Build "Execute shell" script
#
# Pedro Melo <melo@simplicidade.org>
## Die on any errors
set -ex
export OUTPUT=$WORKSPACE/logs
@pfig
pfig / server.py
Last active April 19, 2017 17:09
HTTP server producing a stream of RecordIO data
#
# Run with gunicorn -k eventlet server:app
#
# Dependencies:
# eventlet==0.21.0
# Flask==0.12.1
# gunicorn==19.7.1
#
import time
import random
@pfig
pfig / compose.py
Created December 20, 2016 22:26 — forked from TomWhitwell/compose.py
Python script to generate random scores for modular synth
import random
import string
# -*- coding: utf-8 -*-
def randomname(length = 6):
vowels = ['a','e','i','o','u','']
consonants = ['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']
a = random.sample(consonants,length/2)
x = 1