This file contains 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
Vue.prototype.$forceCompute= function(computedName, forceUpdate /* default: true */) { | |
if (this._computedWatchers[computedName]) { | |
this._computedWatchers[computedName].run(); | |
if (forceUpdate || typeof forceUpdate == 'undefined') this.$forceUpdate() | |
} | |
} | |
this.$forceCompute('title') | |
this.$forceCompute('title', false) // No force update |
This file contains 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
/* | |
How can we read all data from a firestore collection? | |
HI guys I want to show you how. | |
I had these problems for reading all data from a firestore collection: | |
1. firestore cursor is not proper as a powerful cursor as to be able make this task done. | |
2. after few thousands request you will get Bandwidth Exhausted error. | |
For doing this task we need two things and each one can helps us resolve above problems: | |
1. A powerfull cursor |
This file contains 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 copyToClipboard = str => { | |
const el = document.createElement('textarea'); | |
el.value = str; | |
el.setAttribute('readonly', ''); | |
el.style.position = 'absolute'; | |
el.style.left = '-9999px'; | |
document.body.appendChild(el); | |
el.select(); | |
document.execCommand('copy'); | |
document.body.removeChild(el); |
This file contains 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 moment from 'moment'; | |
Object.defineProperty(Vue.prototype, '$moment', { value: moment }); | |
/*it gives us a distinct advantage: properties created with a descriptor are read-only by default. | |
Instead, our read-only instance method protects our library, and if you attempt to overwrite it you will get "TypeError: Cannot assign to read only property".*/ | |
/* | |
We would normally set an object property like this: | |
Vue.prototype.$moment = moment; */ | |
This file contains 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 moment from 'moment'; | |
Object.defineProperty(Vue.prototype, '$moment', { value: moment }); |
This file contains 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
#!/bin/bash | |
# Stop all containers | |
containers=`docker ps -a -q` | |
if [ -n "$containers" ] ; then | |
docker stop $containers | |
fi | |
# Delete all containers | |
containers=`docker ps -a -q` | |
if [ -n "$containers" ]; then | |
docker rm -f -v $containers |
This file contains 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 recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition || window.mozSpeechRecognition || window.msSpeechRecognition)(); | |
recognition.lang = 'en-US'; | |
recognition.interimResults = false; | |
recognition.maxAlternatives = 5; | |
recognition.start(); | |
recognition.onresult = function(event) { | |
console.log('You said: ', event); | |
}; |
This file contains 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 memorySizeOf(obj) { | |
var bytes = 0; | |
function sizeOf(obj) { | |
if(obj !== null && obj !== undefined) { | |
switch(typeof obj) { | |
case 'number': | |
bytes += 8; | |
break; | |
case 'string': |
This file contains 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 editor = grapesjs.init | |
({ | |
height: '100%', | |
fromElement: 1, | |
clearOnRender: true, | |
container : '#gjs', | |
plugins: ['gjs-preset-newsletter'], | |
storageManager: { | |
autosave: false, | |
setStepsBeforeSave: 1, |
This file contains 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
<table width="100%" height="150" class="c2555 c11896 c1366 c16344" style="box-sizing: border-box; height: 150px; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; width: 100%; overflow-wrap: break-word; hyphens: auto; max-width: 550px;"> | |
<tbody class="c11905 c1376 c16355" style="box-sizing: border-box;"> | |
<tr class="c11913 c1385 c16365" style="box-sizing: border-box;"> | |
<td valign="top" class="c2579 c11921 c1394 c16375" style="box-sizing: border-box; font-size: 12px; font-weight: 300; vertical-align: top; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; overflow-wrap: break-word; hyphens: auto;"> | |
<div class="c2730 customText c11929 c1403 c16385" style="box-sizing: border-box; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 17px; font-family: H |
NewerOlder