Skip to content

Instantly share code, notes, and snippets.

View DavidGoussev's full-sized avatar

David Goussev DavidGoussev

View GitHub Profile
@DavidGoussev
DavidGoussev / def pitch_class(note)
Last active December 31, 2015 07:05
musical pitch hash
def pitch_class(note)
hash = { 'C' => 0, 'D' => 2, 'E' => 4, 'F' => 5, 'G' => 7, 'A' => 9, 'B' => 11 }
if note == 'B#'
return 0
elsif note == 'Cb'
return 11
elsif note.length > 2
return nil
elsif note.include?('#')
hash[note.delete('#')] + 1
@DavidGoussev
DavidGoussev / commentbox.js
Created September 26, 2015 22:30
react commentbox js
var Comment = React.createClass({
rawMarkup: function() {
var rawMarkup = marked(this.props.children.toString(), {sanitize: true});
return { __html: rawMarkup };
},
render: function() {
return (
<div className="comment">
<h2 className="commentAuthor">