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
<html> | |
<head> | |
<title>Test</title> | |
<link rel="manifest" href="manifest.json"> | |
</head> | |
<body> | |
<p> | |
If the <code>beforeinstallprompt</code> event fires, there will be a button displayed allowing | |
you to use <code>prompt()</code> on the deferred event. | |
</p> |
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
// [START initialize_firebase_in_sw] | |
// Give the service worker access to Firebase Messaging. | |
// Note that you can only use Firebase Messaging here, other Firebase libraries | |
// are not available in the service worker. | |
importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-app.js'); | |
importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-messaging.js'); | |
// Initialize the Firebase app in the service worker by passing in the | |
// messagingSenderId. | |
firebase.initializeApp({ |
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 getScrollDirection() { | |
let previous = window.scrollY | |
window.addEventListener('scroll', e => { | |
if(window.scrollY > previous){ | |
console.log('going down') | |
}else{ | |
console.log('going up') | |
} | |
previous = window.scrollY | |
}) |
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 itObj(arr, value){ | |
let nowIdx = -1 | |
let itrObj = { | |
next(){ | |
nowIdx += 1 | |
if(nowIdx > arr.length - 1){ | |
return {done: 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
// window.location = '/foo' > pushes a new history entry > causes reload | |
// window.location = '/#foo' > does not push new history entry > does not cause reload | |
// window.history.pushState({name: 'Foo'}, 'foo', '/foo') > pushes a new history entry > does not cause reaload > has state object | |
// window.history.replaceState({name: 'Bar'}, 'bar', '/bar') > same as pushState but does not push a new history entry rather Overrides |
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
// Blob to Canvas | |
// looks like we get Blob from FileReader API | |
// turn Blob into Canvas | |
// to do that we can use `blueimp-load-image` module/library | |
// look for the Exif orientation attribute to set it to `true` | |
// let's look at some related info - | |
let img = new Image() |
- Text Content Generator - http://www.lipsum.com
- Favicon Generator - http://tools.dynamicdrive.com/favicon
- Data Generator - https://mockaroo.com/
- Mobile Mockup Generator - https://mockuphone.com
- Logo Generator - https://www.logaster.com
- UUID Generator - https://www.uuidgenerator.net/
- Hash Generator - https://passwordsgenerator.net/sha256-hash-generator/
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
# Login via SSH with password (LOCAL SERVER) | |
> ssh [email protected] | |
# Create folder, file, install Apache (Just messing around) | |
mkdir test | |
cd test | |
touch hello.txt | |
sudo apt-get install apache2 | |
# Generate Keys |