This file contains hidden or 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 'rumba' | |
Rumba.new('/dev/tty.usbserial') do | |
safe_mode | |
forward foot(1) | |
rotate :left | |
end |
This file contains hidden or 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
# Direction can either be a Fixnum for number of degrees, | |
# or a symbol for the direction (:left, :right) | |
def rotate(direction, speed: DEFAULT_SPEED) | |
# handle symbols... | |
case direction | |
when :left | |
direction = -90 | |
when :right | |
direction = 90 | |
end |
This file contains hidden or 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 'roomba/sensors' | |
class Roomba | |
include Sensors | |
# now I have the constants! yay! | |
end |
This file contains hidden or 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
function f() { | |
types=( ruby css html sass js scala shell go ) | |
for i in "${types[@]}" | |
do | |
ag --$i "$@" app/ engines/ | |
done | |
} |
This file contains hidden or 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
alias ff="ag --ruby --css --html --sass --js --scala --shell --go " | |
function f() { | |
ff "$@" app/ engines/; | |
} |
This file contains hidden or 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 | |
require 'uri' | |
require 'open-uri' | |
BASE_URI = "https://compass-ssb.tamu.edu/pls/PROD/bwykschd.p_disp_detail_sched?term_in=201431&crn_in=" | |
# each course is represented by a CRN number | |
crns = %w[21179 12263 12265 12266 12267 12268 12271 21180] |
This file contains hidden or 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
// ---- | |
// Sass (v3.3.7) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
$foo: "random"; | |
.foo { | |
left: call($foo, 10); | |
} |
This file contains hidden or 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
// ---- | |
// Sass (v3.3.7) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
$class-slug: for; | |
@for $i from 1 through 4 { | |
.#{$class-slug}-#{$i} { | |
width: 60px + $i; |
This file contains hidden or 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
# search for files! | |
alias ff="ack --ruby --css --html --yaml --sass --js --scala --xml --shell" | |
# limit scope of search to directories that normally have the code we want :D | |
function f() { | |
ff "$@" app/ engines/; | |
} |
This file contains hidden or 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
module SurveysToBeTaken | |
def survey_index | |
@today = Date.today.strftime("%m/%d/%Y") | |
# Take all surveys and only fetch current_users results. This also checks | |
map_survey_ids = Survey.pluck(:id) | |
user = params[:user_id].present? ? params[:user_id] : current_user.id |