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
| # Shannon Crabill - Full Stack Software Engineer | |
| ## Contact & Social Links | |
| - Email: shannon.crabill@gmail.com | |
| - Github: https://github.com/scrabill | |
| - Personal Website: http://www.shannoncrabill.com | |
| - Blog: http://www.shannoncrabill.com/blog | |
| - Linkedin: https://www.linkedin.com/in/shannoncrabill/ | |
| ## Summary |
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
| // Example 2 | |
| function moveToEnd(array, number) { | |
| if (number > array.length) { | |
| number = number % array.length | |
| } | |
| for ( let i = 0; i < number; i++ ) { | |
| let itemToMove = array.shift() |
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
| // Example 1 | |
| function moveToEnd(array, number) { | |
| for ( let i = 0; i < number; i++ ) { | |
| let itemToMove = array.shift() | |
| array.push(itemToMove) | |
| } | |
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
| def self.most_popular | |
| all_items = [] | |
| Order.all.each do |order| | |
| all_items << order.menu_items | |
| end | |
| all_items.flatten! |
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
| # From this... | |
| def create | |
| @order = Order.create(order_params) | |
| if @order.save | |
| redirect_to order_path(@order) | |
| else | |
| render :new | |
| end | |
| 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
| class User < ApplicationRecord | |
| has_secure_password | |
| has_many :orders | |
| end | |
| class Order < ApplicationRecord | |
| belongs_to :user | |
| has_many :order_items | |
| has_many :menu_items, through: :order_items | |
| 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
| print("Cambridge April 2015 coding challange submition") | |
| print("By Elliot Lee-Cerrino year 12 student") | |
| table = [] | |
| percent = -1 | |
| def displayName(index):#Used to format the names, scores and percentages of each studen | |
| global table | |
| name = table[index][0] |
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
| EMAIL-GREP-PATTERN | |
| <!-- Please remove all commented out code before using. Visit https://gist.github.com/ccstone/5385334 for more regular expressions available in TextWrangler --> | |
| <!-- \r is line break, \s is non whitespace, \t tab, this looks for table cells and image tags with missing attributes --> | |
| |<td>|<td>\r*?\s*?\t*?<img|(<img\s*(?!.*\r*?.*?\r*?.*?display: ?block.*?\r?)) | |
| <!-- image formatting and styles: height, width, block, alt text --> | |
| |<img\s*(?!.*\r*?.*?\r*?.*?height.*?\r?)|<img\s*(?!.*\r*?.*?\r*?.*?width.*?\r?) | |
| <!-- break tag variants --> | |
| |<br/>|<br> | |
| <!-- special characters --> |
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
| (•_•) | |
| ( •_•)>⌐■-■ | |
| (⌐■_■) |