| Function | Shortcut |
|---|---|
| New Tab | ⌘ + T |
| Close Tab or Window | ⌘ + W (same as many mac apps) |
| Go to Tab | ⌘ + Number Key (ie: ⌘2 is 2nd tab) |
| Go to Split Pane by Direction | ⌘ + Option + Arrow Key |
| Cycle iTerm Windows | ⌘ + backtick (true of all mac apps and works with desktops/mission control) |
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
| const randomRange = (min, max) => { | |
| return Math.floor(Math.random() * (max - min + 1)) + min; | |
| } |
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
| @mixin aspect-ratio($width, $height) { | |
| position: relative; | |
| padding-bottom: ($height / $width) * 100%; | |
| img, | |
| video, | |
| iframe, | |
| object, | |
| embed { | |
| position: absolute; | |
| top: 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
| function copyToClipboard(text) { | |
| var el = document.createElement('textarea'); | |
| el.style.position = 'absolute'; | |
| el.style.left = '-9999px'; | |
| el.setAttribute('readonly', ''); | |
| el.value = text; | |
| document.body.appendChild(el); | |
| el.select(); |
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
| function getClass(obj) { | |
| return {}.toString.call(obj).slice(8, -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
| var resizeID; | |
| window.addEventListener("resize", function () { | |
| clearTimeout(resizeID); | |
| resizeID = setTimeout(resizeHandler, 500); | |
| }); | |
| function resizeHandler() { | |
| /* ... */ | |
| } |
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
| var getPageScroll = (window.pageXOffset !== undefined) ? | |
| function () { | |
| return { | |
| top: pageYOffset, | |
| left: pageXOffset | |
| } | |
| } : function () { | |
| var html = document.documentElement; | |
| var body = document.body; |
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
| if (document.documentElement.closest === undefined) { | |
| Element.prototype.closest = function (css) { | |
| var elem = this; | |
| do { | |
| if (elem.matches(css)) return elem; | |
| elem = elem.parentElement; | |
| } while (elem); | |
| } | |
| } |
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
| @mixin showOnParentHover($parent, $duration: 0.3s) { | |
| & { | |
| visibility: hidden; | |
| opacity: 0; | |
| transition: opacity 0.2s, visibility 0.2s; | |
| } | |
| @at-root .#{$parent}:hover & { | |
| visibility: visible; |
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
| @mixin pseudoIcon($gap, $direction: left) { | |
| @if ($direction == 'left') { | |
| $pseudoElement: before; | |
| } | |
| @else if ($direction == 'right'){ | |
| $pseudoElement: after; | |
| } | |
| @else { | |
| @error "+pseudoIcon: wrong direction"; |
NewerOlder