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
require "serialport" | |
#params for serial port | |
port_str = "/dev/ttyUSB0" #may be different for you | |
baud_rate = 9600 | |
data_bits = 8 | |
stop_bits = 1 | |
parity = SerialPort::NONE | |
#@sp = SerialPort.new("/dev/ttyUSB0", 9600, 8, 1, SerialPort::NONE) |
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
# encoding : utf-8 | |
class Numeric | |
def to_rad | |
self.to_f / 180.0 * Math::PI | |
end | |
def to_deg | |
self.to_f * 180.0 / Math::PI | |
end | |
end |
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
rake routes | sed -e "1d" -e "s,^[^/]*,,g" | awk '{print $1}' | uniq | sort | |
Source: http://trevmex.com/post/3822870892/rails-one-liner-to-get-urls-from-rake-routes |