Skip to content

Instantly share code, notes, and snippets.

@arkadyan
arkadyan / Risset Bell - final version
Created July 5, 2013 21:06
A version of Risset's bell using additive synthesis. Wraps the partials in an envelope to fix the doneAction bug.
SynthDef(
\risset_bell,
{ |freq=440, dur=4.0, out=0|
var partials, addPartial;
partials = Array.new(11);
addPartial = { |amplitude, rel_duration, rel_freq, detune|
partials.add(
EnvGen.kr(
@arkadyan
arkadyan / Risset Bell - take 1
Created July 5, 2013 21:04
A version of Risset's bell using additive synthesis. There's a bug with the doneAction.
SynthDef(
\risset_bell,
{ |freq=440, dur=4.0, out=0|
var partial;
partial = { |amplitude, rel_duration, rel_freq, detune|
OffsetOut.ar(out,
EnvGen.kr(
Env.perc(0.05, dur*rel_duration, amplitude*0.1, -4),
doneAction: 0
@arkadyan
arkadyan / Paste CSV.scpt
Created July 5, 2013 18:38
Paste CSV data into Numbers properly formatted into rows and columns.
set delim to ","
set the clipboard to my remplace(the clipboard as text, delim, tab)
on remplace(_t, _delim, _tab)
local l
set AppleScript's text item delimiters to _delim
set l to text items of _t
set AppleScript's text item delimiters to _tab
set _t to l as text
@arkadyan
arkadyan / OmniFocus Entry from GitHub ticket.scpt
Created July 5, 2013 18:30
Make an OmniFocus inbox entry from a GitHub ticket you are viewing in Safari.
tell application "Safari"
set ticketPage to the document of the front window
set ticketUrl to the URL of ticketPage
set nameArray to my splitText((name of ticketPage), " · ")
set ticketTitle to the first item of nameArray
end tell
tell application "OmniFocus" to tell default document
make new inbox task with properties {name:ticketTitle, note:ticketUrl}
end tell
@arkadyan
arkadyan / View Artist on AllMusic.scpt
Last active December 19, 2015 04:19
AppleScript to view the currently playing artist in iTunes on AllMusic.
tell application "iTunes"
if player state is not stopped then
set currentArtist to artist of current track
end if
end tell
tell application "Safari"
open location "http://www.allmusic.com/search/all/" & currentArtist
end tell
@arkadyan
arkadyan / 2011_hot_dog_prices.csv
Created March 24, 2012 13:39
Prices of Hot Dogs at MLB Parks in 2011
Team 2011 Hot Dog Price (US$) 2010 Hot Dog Price (US$) 2009 Hot Dog Price (US$)
Boston Red Sox 4.50 4.50 4.50
New York Yankees 3.00 3.00 3.00
Chicago Cubs 4.50 4.25 3.00
Chicago White Sox 3.50 3.25 3.25
New York Mets 5.00 5.00 4.75
Philadelphia Phillies 3.75 3.75 3.75
Los Angeles Dodgers 5.00 5.00 5.00
St. Louis Cardinals 4.25 4.00 4.00
Houston Astros 4.75 4.75 4.75
@arkadyan
arkadyan / git_prompt.sh
Created September 14, 2011 22:00 — forked from matthewmccullough/gist:47267
Show Git dirty status in your Unix bash prompt. Shows the current user and host, and uses '$' for the prompt delimiter.
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"