Skip to content

Instantly share code, notes, and snippets.

@aturley
aturley / daisy-hvcc-midi-test.pd
Created July 28, 2024 04:21
This is a very simple test patch that blinks one of the LEDs (to show that the program is running) and plays a tone that can be adjusted with MIDI noteon messages. When I compile it with hvcc and then build it and install it on the Daisy it runs fine (for hours) until I start sending it MIDI messages, at which point it crashes (the LED stops bli…
#N canvas 63 101 450 300 12;
#X obj 107 216 osc~;
#X obj 107 242 dac~;
#X obj 109 185 mtof;
#X obj 199 98 loadbang;
#X msg 201 136 60;
#X obj 60 8 notein;
#X obj 305 92 metro 500;
#X obj 305 116 f;
#X obj 339 118 + 1;
@aturley
aturley / proposal-guidelines.md
Created February 6, 2019 18:29
pony gsoc 2019 proposal guidelines

Name and Contact Information

Please provide information that can be used to contact you. This includes:

  • full name
  • email address
  • telephone number
  • current postal address
  • postal address where you plan to be during the Summer (if known)
  • website link (optional)
@aturley
aturley / twitch-irc-bot.pony
Created December 19, 2018 21:03
A Twitch IRC bot written from scratch in Pony
use "buffered"
use "debug"
use "net"
class TwitchChatConnectionNotify is TCPConnectionNotify
let _nick: String
let _password: String
let _reader: Reader
new iso create(nick: String, password: String) =>
@aturley
aturley / chat_server.pony
Created April 3, 2018 13:31
Basic TCP chat server in Pony
use "net"
actor ConnectionHub
let _connections: Array[TCPConnection] = Array[TCPConnection]
be add(conn: TCPConnection) =>
_connections.push(conn)
be remove(conn: TCPConnection) =>
try _connections.remove(_connections.find(conn)?, 1) end
@aturley
aturley / pony-considerations.md
Last active March 17, 2023 03:21
Information about Pony based on the items outlined in https://twitter.com/casio_juarez/status/898706225642086400

Pony Considerations

If you're thinking of checking out the Pony programming language, here's a list of things that I think are important to know. This list is based on a Tweet that I wrote.

Editor/IDE support

There are Pony packages for several popular editors.

@aturley
aturley / hexdump.pony
Created August 1, 2016 19:25
Naive implementation of a simple hexdump utility in Pony.
class Notify is StdinNotify
let _main: Main tag
new create(main: Main tag) =>
_main = main
fun ref apply(data: Array[U8] iso) =>
_main.add_bytes(consume data)
fun dispose() =>

What?

Need\Have iso trn ref val box tag
iso
trn
ref
val
box
tag
@aturley
aturley / sqlite-in-5-minutes.pony
Last active June 26, 2020 10:58
This is a Pony reimplementation of the C example from the SQLite quickstart page (http://sqlite.org/quickstart.html), using Pony's FFI system (http://tutorial.ponylang.org/c-ffi/calling-c/). In writing it I found a bug in Pony (which was subsequently fixed), so the exercise was good for something other than just learning. I'm still learning Pony…
use "collections"
use "lib:sqlite3"
actor Main
let _env: Env
new create(env: Env) =>
_env = env
let args = env.args
var db: Pointer[U8] = Pointer[U8]
let lit = [(lambda(s:String): String ref => String().append(s) end, lambda(s:String): String ref => String().append(s) end),
(lambda(s:String): String ref => String().append(s).append(s) end, lambda(s:String): String ref => String().append(s).append(s) end),
(lambda(s:String): String ref => String().append(s).append(s).append(s) end, lambda(s:String): String ref => String().append(s).append(s).append(s) end)]
var result = String()
for (la, lb) in lit.values() do
result = result.append(la("a")).append(lb("b"))
end
@aturley
aturley / gist:8302694
Last active April 1, 2016 20:39
BLOGPOST Just Say "No" to "Just

Recently I've been trying to modify the way that I use the word "just" when I'm at work. Merriam Webster offers a few definitions of the word; the one I'm interested in is the one that means "only", "simply", and to a lesser extent "exactly". I've been working on a new project that involves integrating a number of systems, and as I began rolling pieces out I received a lot a questions in the form of "Couldn't you just ...?" These annoyed me at first, but as I thought about it I realized I often asked questions in the same way, so I began to examine the word and the way I use it.