Skip to content

Instantly share code, notes, and snippets.

View web-crab's full-sized avatar

Andrey Klimash web-crab

View GitHub Profile
<!--
https://csswizardry.com/2020/05/the-fastest-google-fonts/
- 1. Preemptively warm up the fonts’ origin.
-
- 2. Initiate a high-priority, asynchronous fetch for the CSS file. Works in
- most modern browsers.
-
- 3. Initiate a low-priority, asynchronous fetch that gets applied to the page
- only after it’s arrived. Works in all browsers with JavaScript enabled.
-
$min-mobile-width = 320
$max-desktop-width = 1200
html
font-size: 10px
@media (max-width: $min-mobile-width)
font-size calc((100vw / $min-mobile-width) * 10)
@media(orientation: landscape)
font-size calc(10px - (100vw - 100vh) / 100)
import Vue from 'vue'
export default (api) => ({
namespaced: true,
state: {
list: []
},
getters: {
idxMap: state => state.list.reduce((map, { id }, i) => {
map[id] = i
<template functional>
<div class="loader">
<div></div>
<div></div>
<div></div>
</div>
</template>
<style>
@keyframes loader {
^[a-zA-Z0-9!#$%&'*+\\\-/=?^_`{|}~.]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$
const FOCUSABLE = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable]'
export default class Modal {
  constructor (options) {
    const focusableChildren = options.el.querySelectorAll(FOCUSABLE)
    this.el = options.el
    this.activeClass = options.activeClass
    this.firstFocusableChild = focusableChildren[0]
    this.lastFocusableChild = focusableChildren[focusableChildren.length - 1]
    this.elBeforeOpen = null
var names = ['John Doe'];
for (var i = 0; i < names.length; i++) {
app.activeDocument.activeLayer.textItem.contents = names[i];
app.activeDocument.saveAs(
new File('~/Desktop/' + names[i] + '.tif'), 10),
new TiffSaveOptions(),
true
);
}
/*
Авторизация с токенами access и refresh для Vue.js
Пример использования:
Vue.use(Auth, {
http, // экземпляр Axios
router, // экземпляр VueRouter,
routes: {
login: '/login',
register: '/login?register',
// Promise: https://github.com/taylorhakes/promise-polyfill
// fetch: https://github.com/developit/unfetch
// ScrollIntoView: https://github.com/KoryNunn/scroll-into-view
if (Array.prototype.find === undefined) {
Array.prototype.find = function (fn) {
for (var i = 0, l = this.length; i < l; i++) {
if (fn(this[i], i, this)) {
return this[i];
}
{
"name": "App Name",
"short_name": "App Name",
"icons": [
{
"src": "/192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{