Drop the following script into your path somewhere, I keep it in ~/bin.
Then add a git alias for bro
git config --global alias.bro !git-browseDrop the following script into your path somewhere, I keep it in ~/bin.
Then add a git alias for bro
git config --global alias.bro !git-browse| # Live coding example for Retune conference 2014 | |
| # 1) Press Run (Cmd+R) to start | |
| # 2) Make changes (e.g. comment in/out various lines in :beats & :amen) | |
| # 3) Press Run again (changes will only be audible from next queue point) | |
| # compute loop length (4 bars), bar & quarter note durations | |
| dur = sample_duration :loop_compus | |
| bar = dur / 4 | |
| quart = dur / 16 |
| var mqtt = require('mqtt') | |
| // Make sure to change this to the IP address of your MQTT server | |
| , host = '192.168.128.204' // or localhost | |
| client = mqtt.createClient(1883, host, {keepalive: 10000}); | |
| // Subscribe to the temperature topic | |
| client.subscribe('temperature'); | |
| // When a temperature is published, it will show up here | |
| client.on('message', function (topic, message) { |
I was curious about making retro gaming sounds using Sonic Pi. A couple of months and a lot of Googling later, here's the original Mario Bros theme as it was heard on the NES console.
I'm (just about) old enough to remember rushing home from school to play this game at Philip Boucher's house, sitting cross-legged in front of the TV till my feet got pins and needles. Working out how to recreate it for Sonic Pi was a lot of fun!
| ### Rails app generator template. Run it: | |
| ### rails new _app_name_ -m https://gist.githubusercontent.com/DamirSvrtan/28a28e50d639b9445bbc/raw/app_template.rb | |
| remove_file "README.rdoc" | |
| create_file "README.md", "Development: run ./bin/setup" | |
| run 'mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss' | |
| database_type = ask("Do you want to use postgres or mysql?", limited_to: ["pg", "mysql"]) | |
| adapter = if database_type == 'pg' |
Quick reference:
screen /dev/tty.usbmodem1d113 115200 (tty)
ssh [email protected] (ethernet)
ssh [email protected] (usb0)
| class Brain: NSObject, PNDelegate { | |
| let config = PNConfiguration(forOrigin: "pubsub.pubnub.com", publishKey: "demo", subscribeKey: "demo", secretKey: nil) | |
| var channel = PNChannel() | |
| var serverStatus = UILabel() | |
| init() { | |
| super.init() | |
| } | |
| } |
| # DUBSTEP | |
| # Combines ideas from my other gists | |
| current_bpm = 140.0 | |
| use_bpm current_bpm | |
| # WOBBLE BASS | |
| define :wob do | |
| use_synth :dsaw | |
| lowcut = note(:E1) # ~ 40Hz | |
| highcut = note(:G8) # ~ 3000Hz |
| # Defining standalone wobble | |
| # WOBBLE BASS | |
| define :wob do |note, no_of_wobs, duration| | |
| # using in_thread so we don't block everything | |
| in_thread do | |
| use_synth :dsaw | |
| lowcut = note(:E1) # ~ 40Hz | |
| highcut = note(:G8) # ~ 3000Hz | |
| # Playing ASCII drum tabs with Sonic Pi | |
| # Ruby is an awesome language for String manipulation. | |
| # Lets use that fact to play some drums! | |
| # Tab for the Amen break taken from Wikipedia | |
| # http://en.wikipedia.org/wiki/Amen_break | |
| # Note that %Q{ ... } is just another way | |
| # to define a string in Ruby |