Skip to content

Instantly share code, notes, and snippets.

@JiggyPete
JiggyPete / mario midi controls
Last active January 11, 2017 21:17
mario midi controls
// 1: Visit http://mario5.florian-rappl.de/#menu
// 2: Copy and paste the following code into the console
// 3: You may need to update the pad id's for your midi controller. Output will appear in the console when you press pads, take the 2nd value from each pad event and tweak the controller values at the bottom of this script, then paste it into the console again.
// request MIDI access
if (navigator.requestMIDIAccess) {
navigator.requestMIDIAccess({
sysex: false // this defaults to 'false' and we won't be covering sysex in this article.
}).then(onMIDISuccess, onMIDIFailure);
} else {
@mlr
mlr / rspec_rails_cheetsheet.rb
Last active October 26, 2023 14:32 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet with expect syntax (including capybara matchers)
# Model
expect(@user).to have(1).error_on(:username) # checks whether there is an error in username
expect(@user.errors[:username]).to include("can't be blank") # check for the error message
# Rendering
expect(response).to render_template(:index)
# Redirecting