Table of Contents generated with DocToc
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 PlaygroundSupport | |
| import UIKit | |
| func makeLabels(left: String, right: String) -> (UIView, UILabel, UILabel) { | |
| let leftLb: UILabel = { | |
| let label = UILabel(frame: .zero) | |
| label.textAlignment = .left | |
| label.backgroundColor = .blue | |
| label.text = left | |
| return label |
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
| // Last-In, First-Out | |
| var stack = []; | |
| stack.push(2); // stack is now [2] | |
| stack.push(5); // stack is now [2, 5] | |
| var i = stack.pop(); // stack is now [2] | |
| alert(i); // displays 5 | |
| // First-In First-Out | |
| var queue = []; | |
| queue.push(2); // queue is now [2] |
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
| // Accepts the array and key | |
| const groupBy = (array, key) => { | |
| // Return the end result | |
| return array.reduce((result, currentValue) => { | |
| // If an array already present for key, push it to the array. Else create an array and push the object | |
| (result[currentValue[key]] = result[currentValue[key]] || []).push( | |
| currentValue | |
| ); | |
| // Return the current iteration `result` value, this will be taken as next iteration `result` value and accumulate | |
| return 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
| // -------------------------------------------------- | |
| // Flexbox SASS mixins | |
| // The spec: http://www.w3.org/TR/css3-flexbox | |
| // -------------------------------------------------- | |
| // Flexbox display | |
| @mixin flexbox() { | |
| display: -webkit-box; | |
| display: -moz-box; | |
| display: -ms-flexbox; |
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
| <div id="root"> | |
| <h2>Add New Task</h2> | |
| <div class="todo-new"> | |
| <div class="todo-new__item"> | |
| <input type="text" | |
| placeholder="Feeling productive?" | |
| v-model="task" /> | |
| <button @click="addTask()">Just do it!</button> | |
| </div> | |
| </div> |
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
| /*------------------------------------------ | |
| Responsive Grid Media Queries - 1280, 1024, 768, 480 | |
| 1280-1024 - desktop (default grid) | |
| 1024-768 - tablet landscape | |
| 768-480 - tablet | |
| 480-less - phone landscape & smaller | |
| --------------------------------------------*/ | |
| @media all and (min-width: 1024px) and (max-width: 1280px) { } | |
| @media all and (min-width: 768px) and (max-width: 1024px) { } |
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
| /* | |
| * File: bst.js | |
| * | |
| * A pure JavaScript implementation of a binary search tree. | |
| * | |
| */ | |
| /* | |
| * Class: BST | |
| * |
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
| I use the first | |
| —– BEGIN LICENSE —– | |
| Michael Barnes | |
| Single User License | |
| EA7E-821385 | |
| 8A353C41 872A0D5C DF9B2950 AFF6F667 | |
| C458EA6D 8EA3C286 98D1D650 131A97AB | |
| AA919AEC EF20E143 B361B1E7 4C8B7F04 |
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 branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
NewerOlder