Skip to content

Instantly share code, notes, and snippets.

Pedro Figueiredo pfig

Block or report user

Report or block pfig

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pfig
pfig / BootTidal.hs
Last active Sep 4, 2019
Tidal startup errors in emacs
View BootTidal.hs
-- $ 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
View gist:e7ccc7ca9832748dccf91d67c03c4cff
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 / server.py
Last active Apr 19, 2017
HTTP server producing a stream of RecordIO data
View server.py
#
# 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 Dec 20, 2016 — forked from TomWhitwell/compose.py
Python script to generate random scores for modular synth
View compose.py
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
@pfig
pfig / rain.scd
Created Oct 10, 2016
A crude driver for my attempts at phase music
View rain.scd
s.quit;
s.boot;
(
b = Buffer.read(s, thisProcess.nowExecutingPath.dirname +/+ "press_the_red_again.wav");
k = Buffer.read(s, thisProcess.nowExecutingPath.dirname +/+ "kissy_face.wav");
m = Buffer.read(s, thisProcess.nowExecutingPath.dirname +/+ "notice_me_senpai_short.aiff");
// Create a Synth capable of all the transforms we want
SynthDef(\reich, {
View pep-20.md

From Tim Peters's Zen of Python

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
@pfig
pfig / be.pfig.notebooks.plist
Created Sep 17, 2015
iPython notebooks managed by launchctl
View be.pfig.notebooks.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>be.pfig.notebooks</string>
<key>ProgramArguments</key>
<array>
<string>ipython</string>
<string>notebook</string>
@pfig
pfig / gist:0508a1c735e1b0bf6219
Created Apr 5, 2015
5-star album reviews from The Guardian
View gist:0508a1c735e1b0bf6219
# cf http://www.theguardian.com/info/developer-blog/2015/feb/10/what-to-listen-to-next-jq-to-the-rescue
URL='http://content.guardianapis.com/search?api-key=test&page-size=100&show-fields=starRating&tag=tone/albumreview,tone/reviews&from-date=2015-01-03'
curl -s $URL | jq \
'[.response.results[] | select((.fields.starRating | tonumber) == 5) | {webTitle, webUrl}]'
View keybase.md

Keybase proof

I hereby claim:

  • I am pfig on github.
  • I am pfig (https://keybase.io/pfig) on keybase.
  • I have a public key whose fingerprint is 4A46 D391 411F EB63 1797 119B 66A4 7DA9 0F9F C14A

To claim this, I am signing this object:

View Solarized (Dark).tmTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Solarized (dark)</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
You can’t perform that action at this time.