// optionaly check if prefix already exists
const string = 'localhost:8080'
!string.startsWith('http://') ? 'http://localhost:8080' : ''
const newString = `http://${string}`
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 catchErrors(fn) { | |
return function (...args) { | |
return fn(...args).catch((err) => { | |
console.error('Ohhhh nooo!!!!!'); | |
console.error(err); | |
}); | |
} | |
} | |
const catchError = (fn) => (...params) => fn(...params).catch(e => console.error(e)) |
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
.container > div { | |
background: #373142; | |
color: #fff; | |
width: 100px; | |
height: 100px; | |
text-align: center; | |
line-height: 100px; | |
margin: 5px; | |
} |
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
//'this' can only access properties in its current level or below using the dot operator (this.friends.amis). It can access upper levels by referencing the object name (nestedObject.nom) | |
// no matter how nested the object is, 'this' is an arrow function will always reference the context right **outside** the object. | |
let nestedObject = { | |
nom: 'Jérôme', | |
logDenis() { | |
console.log(this.friends.amis) | |
}, | |
friends: { |
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
/* These rules focus Chrome in first line */ | |
body { | |
margin: 0; | |
} | |
html { | |
box-sizing: border-box; | |
} | |
*, |
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
//pass vm (name is up to you) to data function in order get access to the present vue instance in nested objects | |
data: vm => ({ | |
valid: true, | |
name: '', | |
email: '', | |
password: '', | |
confirmPassword: '', | |
// in a non nested object, 'this' is enough to access the properties in the data function | |
/* matchPassword2() { | |
return this.password === this.confirmPassword || 'Password do not match.' |
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
//pass vm (name is up to you) to data function in order get access to the present vue instance in nested objects | |
data: vm => ({ | |
valid: true, | |
name: '', | |
email: '', | |
password: '', | |
confirmPassword: '', | |
// in a non nested object, 'this' is enough to access the properties in the data function | |
/* matchPassword2() { | |
return this.password === this.confirmPassword || 'Password do not match.' |
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
<template functional> | |
<div class="test"> | |
<h1>{{props.msg}}</h1> | |
<h2>Static content</h2> | |
<span v-for="n in 10">{{n}} </span> | |
<button @click="console.log('click', props.msg)"><slot></slot></button> | |
</div> | |
</template> | |
<script> |
If you're trying to do this, you came to the right place!
See this code in action here: https://twitter.com/CodingDoug/status/953031540811825152
- Create a Firebase project at the Firebase Console
use max-height or translate off screen