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 'rubygems' | |
| require 'google_drive' | |
| require 'csv' | |
| # Go get your consumer key, client_secret, and client_id for Google Drive here https://code.google.com/apis/console/ | |
| consumer_key = 'INSERT YOUR CONSUMER_KEY HERE' | |
| client_secret = 'INSERT YOUR CLIENT_SECRET HERE' | |
| client_id = 'INSERT YOUR CLIENT_ID HERE' | |
| client = OAuth2::Client.new( |
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
| # DBC Week 4 Ruby Assessment | |
| # Tanner Welsh | |
| # ____________ | |
| ###################################################################################### | |
| ### PART 1 : OO Design ############################################################### | |
| # module AddressBook | |
| # |
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
| #!/bin/bash | |
| # UPDATE: This is a waste of code. This script can | |
| # be executed in a single line: | |
| # find * -type d -exec touch '{}/.gitkeep' \; | |
| # Execution takes two arguments: | |
| # 1: Name of directory to traverse | |
| # 2: Name of file to create in each subdirectory |
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
| # Setup an array of 99 numbers between 1 and 100, randomly sorted | |
| @numbers = (1..1_000_000).to_a.shuffle | |
| @numbers.delete_at(rand(1_000_000)) | |
| def sort_find | |
| sorted = @numbers.sort | |
| sorted.each_with_index do |n, i| | |
| next if n == sorted[i-1] + 1 || n == 1 | |
| return n-1 |
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
| #!/bin/bash | |
| echo "Installing debugger gem..." | |
| gem install 'debugger' | |
| echo "Creating and modifying ~/.rdebugrc config file..." | |
| touch ~/.rdebugrc | |
| echo -e "set autolist\nset autoeval\nset autoreload" > ~/.rdebugrc |
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
| #!/bin/bash | |
| # <<< gistclone >>> | |
| # | |
| # Why clone gists with HTTP when you can use SSH? | |
| # | |
| # Just put this somewhere in your PATH, make it executable, and you're good to go. | |
| # | |
| # Usage: | |
| # $ gistclone <gist_url> [<directory>] |
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_relative "university" | |
| University.open_db | |
| student = University::Student.new('Tanner Welsh') | |
| student.save | |
| student = University::Student.new('Mike Busch') | |
| student.save |
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
| // List of 1000 basic English words from Wikipedia | |
| // https://simple.wikipedia.org/wiki/Wikipedia:List_of_1000_basic_words | |
| var BASIC_WORDS = ['a', 'about', 'above', 'across', 'act', 'active', 'activity', 'add', 'afraid', 'after', 'again', 'age', 'ago', 'agree', 'air', 'all', 'alone', 'along', 'already', 'always', 'am', 'amount', 'an', 'and', 'angry', 'another', 'answer', 'any', 'anyone', 'anything', 'anytime', 'appear', 'apple', 'are', 'area', 'arm', 'army', 'around', 'arrive', 'art', 'as', 'ask', 'at', 'attack', 'aunt', 'autumn', 'away', 'baby', 'back', 'bad', 'bag', 'ball', 'bank', 'base', 'basket', 'bath', 'be', 'bean', 'bear', 'beautiful', 'bed', 'bedroom', 'beer', 'behave', 'before', 'begin', 'behind', 'bell', 'below', 'besides', 'best', 'better', 'between', 'big', 'bird', 'birth', 'birthday', 'bit', 'bite', 'black', 'bleed', 'block', 'blood', 'blow', 'blue', 'board', 'boat', 'body', 'boil', 'bone', 'book', 'border', 'born', 'borrow', 'both', 'bottle', 'bottom', 'bowl', 'box', 'boy', 'branch', 'brave', ' |
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
| // This is a very bare-bones (and incomplete) implementation of the idea | |
| // behind Promise, using a new function called Commitment: | |
| const Commitment = function(func) { | |
| this.state = 'PENDING' // will be changed to 'FULFILLED' or 'REJECTED' | |
| const resolve = (result) => { | |
| this.state = 'FULFILLED' | |
| this.resolver && this.resolver(result) | |
| } |
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
| source 'https://rubygems.org' | |
| gem 'unimidi' | |
| gem 'midi-message' | |
| gem 'activesupport', '~> 4.2.3' |
OlderNewer