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 Product = { | |
| name: 'Some name', | |
| price: 10, | |
| set discount(x) { | |
| this.disc = x; | |
| }, | |
| get discount() { | |
| return this.disc; | |
| } |
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
| 0440ff4945d40ead38931da46a20b9af44d5de99e14b7bb38f5aca58b39c225af916a3c3c75d27d03693758c2de92e2c2cc1ea1515bfc4aaaff44b9dc899c444c4 |
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 fs = require('fs-extra'); | |
| const postcss = require('postcss'); | |
| const postcssrc = require('postcss-load-config'); | |
| const folder = './folder/'; | |
| const outputFolder = './out'; | |
| const run = async () => { | |
| const files = await fs.readdir(folder); |
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 skeleton following the-frontend-checklist": { | |
| "prefix": "html:meta", | |
| "body": [ | |
| "<!doctype html>", | |
| "<html lang=\"$1en\">", | |
| "\t<head>", | |
| "\t\t<title>$2</title>", | |
| "\t\t<meta charset=\"UTF-8\">", | |
| "\t\t<meta http-equiv=\"x-ua-compatible\" content=\"ie=edge\">", |
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
| self.onfetch = event => { | |
| // Ignore non-get request like when accessing the admin panel | |
| if (event.request.method !== 'GET') { return; } | |
| // Don't try to handle non-secure assets because fetch will fail | |
| if (!/api\/v1/.test(event.request.url)) { return; } | |
| // Here's where we cache all the things! | |
| event.respondWith( | |
| // Open the cache created when install | |
| caches.open('OFFLINE_CACHE').then(function(cache) { |
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
| 'use strict'; | |
| const {resolve, join} = require('path'); | |
| const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
| const WorkboxPlugin = require('workbox-webpack-plugin'); | |
| const OUTPUT_PATH = resolve('./dist'); | |
| module.exports = { | |
| entry: { |
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
| 'use strict'; | |
| const changeEverything = () => { | |
| setTimeout(() => { | |
| document.querySelector('h1').textContent = 'I was changed!'; | |
| }, 3000); | |
| } | |
| changeEverything(); |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Webpack + Workbox</title> | |
| <style> | |
| 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
| import {Element as PolymerElement} from '@polymer/polymer/polymer-element'; | |
| import User from './../../lib/user'; | |
| import css from './style.postcss'; | |
| import template from './template.html'; | |
| // Import our main application component | |
| import './../sk-app'; |
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
| FROM node | |
| USER node | |
| ENV APP_ID someappid | |
| ENV MASTER_KEY somemasterkey | |
| # Connection strig to mongo db | |
| ENV MONGO_URI mongodb://mongo/test | |
| ENV SERVER_PORT 1337 | |
| # Don't forget to change to https if needed |