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
| document.body.addEventListener('click', event => { | |
| if (!event.target.matches('button[data-clipboard-text]')) { | |
| return; | |
| } | |
| event.preventDefault(); | |
| const href = event.target.getAttribute('data-clipboard-text'); | |
| const location = href.split(','); | |
| console.log(location); | |
| fetch('http://localhost:4444/adb', { |
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
| gzip on; | |
| gzip_disable "msie6"; | |
| gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml; | |
| server { | |
| listen 80 default_server; | |
| listen [::]:80 default_server; | |
| root /usr/share/nginx/html; |
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:14-alpine3.10 AS builder | |
| WORKDIR /usr/src/app | |
| ARG API_ENDPOINT=http://localhost:3333/api | |
| ENV REACT_APP_API_ENDPOINT=$API_ENDPOINT | |
| COPY package*.json ./ | |
| RUN npm ci | |
| COPY . . |
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
| export const IMAGE_OPTIMIZER_OPTIONS = { | |
| MAX_WIDTH: 1920, | |
| MAX_HEIGHT: 1080, | |
| MAX_QUALITY: 0.8 | |
| }; | |
| export function optimizeImageFile(file, {MAX_WIDTH, MAX_HEIGHT, MAX_QUALITY} = IMAGE_OPTIMIZER_OPTIONS) { | |
| return new Promise(resolve => { | |
| const img = document.createElement('img'); |
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
| module.exports = function (config) { | |
| const buzz = `${Date.now()}.buzz`; //change the value to what do you want | |
| if (config.output.filename) { | |
| const splicedOut = config.output.filename.split('.'); | |
| config.output.filename = `${splicedOut.slice(0, -1).join('.')}.${buzz}.${splicedOut.slice(-1).join('.')}`; | |
| } | |
| if (config.output.chunkFilename) { | |
| const splicedOut = config.output.chunkFilename.split('.'); | |
| config.output.chunkFilename = `${splicedOut.slice(0, -1).join('.')}.${buzz}.${splicedOut.slice(-1).join('.')}`; | |
| } |
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 { Component } from '@angular/core'; | |
| import { LoaderService } from './loader.service'; | |
| import { timer } from 'rxjs'; | |
| @Component({ | |
| selector: 'app-root', | |
| template: ` | |
| <p> | |
| <button (click)="randomTimeout()">Random time out</button> | |
| </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
| import { DateAdapter } from 'angular-calendar'; | |
| import { DateTime, DateTimeOptions } from 'luxon'; | |
| export function getLuxonObject(value: Date | string | number, options?: DateTimeOptions & { format?: string }): DateTime { | |
| if (value instanceof DateTime) { | |
| return value; | |
| } | |
| let dateTime: DateTime; | |
| if (value instanceof Date) { | |
| dateTime = DateTime.fromJSDate(value, options); |
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
| (async function (globalOptions) { | |
| let batch = 1; | |
| window['finalResult'] = { | |
| user_id: '', | |
| requestToken: '', | |
| messages: [], | |
| friend: {id: globalOptions.friend_id || 0, name: ''} | |
| }; | |
| if (!finalResult.friend.id) { |
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 kebabCase(str) { | |
| return str.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g, match => '-' + match.toLowerCase()) // lower case and add - | |
| .replace(/[^\w]/g, '-') // replace non-word characters by - | |
| .replace(/-+/g, '-') // remove multiple - characters | |
| .replace(/^-|-$/g, ''); // trim first and last - character | |
| } |
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.addEventListener("message", function (event) { | |
| console.log(event); | |
| }, false); | |
| console.log(123; |