show dbs
This sheet goes along with this SSH YouTube tutorial
$ ssh brad@192.168.1.29
$ mkdir test
$ cd test
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
/** | |
* Filters an array of objects by custom predicates. | |
* | |
* @param {Array} array: the array to filter | |
* @param {Object} filters: an object with the filter criteria | |
* @return {Array} | |
*/ | |
function filterArray(array, filters) { | |
const filterKeys = Object.keys(filters); | |
return array.filter(item => { |
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
<figure class="video-player"> | |
<video preload="none" width="1280" height="720" poster="video.jpg"> | |
<source src="video.webm" type="video/webm" /> | |
<source src="video.mp4" type="video/mp4" /> | |
</video> | |
<button class="play-toggle">Toggle play</button> | |
<button class="mute-toggle">Toggle mute</button> | |
</figure> | |
<script> | |
// Initialize video player |
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 episodeParser({ | |
id, | |
title, | |
description = 'No summary', | |
optionalField, | |
anotherOptionalField | |
}) { | |
return { | |
guid: id, | |
title, |
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
/* | |
* Wraps axios and provides | |
* more convenient post method | |
* calls with payload data | |
*/ | |
export function post(uri, data) { | |
return axios.post(uri, data, { | |
headers: getHeaders(), | |
withCredentials: true | |
}) |
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
/* | |
* Returns default headers list | |
* which will be used with every request. | |
*/ | |
function getHeaders(multipart = false) { | |
let defaultHeaders = BASE_HEADERS | |
if (multipart) { | |
defaultHeaders = {} | |
} |
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 EventBus() { | |
const eventCallbacksPairs = []; | |
this.subscribe = function( eventType, callback ) { | |
const eventCallbacksPair = findEventCallbacksPair(eventType); | |
if(eventCallbacksPair) | |
eventCallbacksPair.callbacks.push(callback); | |
else | |
eventCallbacksPairs.push( new EventCallbacksPair(eventType, callback) ); |
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 spacing($type: 'xl', $property: 'margin-top') { | |
#{$property}: map-get($margins, $type); | |
#{$property}: var(--margin-#{$type}); | |
} | |
:root { | |
--spacing-s: 1.5rem; | |
--spacing-m: 5rem; | |
--spacing-l: 10rem; | |
--spacing-xl: 10rem; |
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
// ---- | |
// Sass (v3.4.21) | |
// Compass (v1.0.3) | |
// ---- | |
// Sass modifiers mixin by Sarah Dayan | |
// Generate All Your Utility Classes with Sass Maps: frontstuff.io/generate-all-your-utility-classes-with-sass-maps | |
// http://frontstuff.io | |
// https://github.com/sarahdayan |
NewerOlder