This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):001:0> require 'active_record' | |
=> true | |
irb(main):002:0> class Test < ActiveRecord::Base | |
irb(main):003:1> self.abstract_class = true | |
irb(main):004:1> end | |
=> true | |
irb(main):005:0> class SubClass < Test | |
irb(main):006:1> end | |
=> nil | |
irb(main):007:0> SubClass.table_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class ChordParser | |
CHROMATICS = ['A', ['A#','Bb'], 'B', 'C', ['C#','Db'], 'D', ['D#','Eb'], 'E', 'F', ['F#','Gb'], 'G', ['G#','Ab']].freeze | |
MAJOR_STEPS = [0, 2, 2, 1, 2, 2, 2].freeze | |
MAJOR_SCALES = (0..11).map do |offset| | |
accumulator = 0 | |
scale = [] | |
MAJOR_STEPS.each_with_index do |increment, index| | |
accumulator += increment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# homebrew dependencies | |
brew install folly autoconf-archive wget boost | |
# wangle | |
curl -L https://github.com/facebook/wangle/archive/v2017.11.06.00.tar.gz | tar xvzf - | |
mkdir wangle-2017.11.06.00/wangle/Release && cd wangle-2017.11.06.00/wangle/Release | |
cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. | |
make -j 8 | |
make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// +build windows | |
package util | |
// Copyright (c) Yasuhiro MATSUMOTO <[email protected]> | |
// | |
// MIT License (Expat) | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
// |