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
| actions: { | |
| handleTrixAttachmentAdd(jqEvent) { | |
| var attachment = jqEvent.originalEvent.attachment; | |
| if (attachment.file) { | |
| // update file to server | |
| // call attachment.setAttributes(); | |
| } | |
| } | |
| } |
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 Ember from 'ember'; | |
| export default Ember.Component.extend({ | |
| attachmentsDisabled: false, | |
| editor: null, | |
| excludeInput: false, | |
| inputId: 'trix-editor-input-id', |
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
| SELECT * FROM users; | |
| INSERT INTO users | |
| (first_name, last_name, email, created_at, updated_at) | |
| VALUES | |
| ('Lynne', 'Tye', 'lynnetye@gmail.com',DATETIME('now'), DATETIME('now')); | |
| ALTER TABLE users | |
| ADD COLUMN nickname VARCHAR(64) NOT NULL DEFAULT ' '; |
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 Stack | |
| def initialize(max_size) | |
| @store = [] | |
| @max_size = max_size | |
| end | |
| def push(x) | |
| raise "Stack Overflow - The stack is full" if self.full? | |
| @store.push x | |
| 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
| Method: Zip | |
| Class: Array (of first and last names) | |
| Format: array1.zip(array2) | |
| Block: none | |
| Result: array of duplets | |
| first_names = ["Lynne", "Lawrence", "Emily", "Leandra"] | |
| last_names = ["Tye", "Yu", "Gerngross", "Kim"] | |
| full_names = first_names.zip(last_names) |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <link type="text/css" rel="stylesheet" href="stylesheet.css"/> | |
| </head> | |
| <body> | |
| <h1>5 Things I Love and Live By</h1> | |
| <p class="header">something</p> |
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
| document.getElementById("unicorn") | |
| document.getElementsByClassName("paragraph-header") | |
| document.getElementsByTagName("p")[0].innerHTML = "Update text." |
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 find_factorial(num) | |
| answer = 1 | |
| num.downto(1) { |x| answer *= x } | |
| return answer | |
| end | |
| p find_factorial(6) # 720 |
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
| (6 factorial) | |
| 6 * (5 factorial) | |
| 6 * (5 * (4 factorial)) | |
| 6 * (5 * (4 * (3 factorial))) | |
| 6 * (5 * (4 * (3 * (2 factorial)))) | |
| 6 * (5 * (4 * (3 * (2 * (1 factorial))))) | |
| 6 * (5 * (4 * (3 * (2 * (1))))) | |
| 6 * (5 * (4 * (3 * (2)))) | |
| 6 * (5 * (4 * (6))) | |
| 6 * (5 * (24)) |
NewerOlder