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
| # Numerical Grade Converter | |
| # | |
| print "What percentage is your grade? " | |
| gradePercent = gets.chomp().to_f | |
| if gradePercent <= 69 | |
| puts "You have earned an F in the class!" | |
| elsif gradePercent <= 72 | |
| puts "You have earned a D in the class!" |
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
| print "Hi. Please enter the product name of your app: " | |
| title = gets | |
| print "Thank you. Now please enter a brief description for your app: " | |
| description = gets | |
| htmlfile = File.new("index.html", "w") | |
| htmlfile.puts '<!DOCTYPE html>' | |
| htmlfile.puts '<html lang="en">' | |
| htmlfile.puts ' <head>' | |
| htmlfile.puts ' <meta charset="utf-8">' | |
| htmlfile.puts " <title>#{title}</title>" |
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
| // connect sine oscillator to D/A convertor (sound card) | |
| SinOsc s => dac; | |
| // set frequency to 440 | |
| 400. => s.freq; | |
| // loop in time | |
| while( true ) { | |
| 2::second => now; | |
| } |
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
| print "We want... a shrubbery!" |
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
| import random | |
| def number_to_name(number): | |
| if number==0: | |
| return 'rock' | |
| elif number==1: | |
| return 'Spock' | |
| elif number==2: | |
| return 'paper' |
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
| // James Michiemo 03nov13 | |
| TriOsc s => dac; | |
| .7 => s.gain; | |
| // music keys for the Final Fantasy Prelude Theme | |
| // 1, 3 | |
| // c d e g g e d | |
| // c d e g g e d c |
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
| lsof -wni tcp:3000 |
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
| #check the current url to see if it matches the remote url | |
| git remote -v | |
| #update to new url with command | |
| git remote set-url origin git@github.com:username/newreponame.git | |
| #ls remote branches to confirm connection | |
| git ls-remote |
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
| git filter-branch --index-filter 'git rm --cached --ignore-unmatch screenshot.png' -- --all |
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
| sum = 0 | |
| (0...1000).each do |i| | |
| sum += i if (i%3 == 0 || i%5 == 0) | |
| end | |
| puts "The sum total of all the multiples of 3 or 5 is #{sum}." |