Skip to content

Instantly share code, notes, and snippets.

View web-crab's full-sized avatar

Andrey Klimash web-crab

View GitHub Profile
@web-crab
web-crab / patterns.js
Last active March 23, 2019 20:02 — forked from KhalilZaidoun/patterns.js
Useful Regex Patterns (Forked from Regex Hub)
export const patterns = [{
name:"Date in format dd/mm/yyyy",
regex:/^(0?[1-9]|[12][0-9]|3[01])([ /\-])(0?[1-9]|1[012])\2([0-9][0-9][0-9][0-9])(([ -])([0-1]?[0-9]|2[0-3]):[0-5]?[0-9]:[0-5]?[0-9])?$/,
description:"Will match dates with dashes, slashes or with spaces (e.g. dd-mm-yyyy dd/mm/yyyy dd mm yyyy), and optional time separated by a space or a dash (e.g. dd-mm-yyyy-hh:mm:ss or dd/mm/yyyy hh:mm:ss).",
tags:"date,time"
},
{
name:"Time in 24-hour format",
regex:/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/,
description: "Match times in 24 hour format",
@web-crab
web-crab / utils.js
Last active November 15, 2019 16:16
export const URL_PATTERNS = [
{ prefix: 'tel', re: /(\+7)[\s\-()0-9]{10,}/ },
{ prefix: 'mailto', re: /^.+@.+$/ }
]
/**
* @param {Promise[]} promises
* @returns Promise
*/
export function promiseQueue (promises = []) {
<template>
<div class="checkbox" @click="isChecked = !isChecked">
<input v-model="isChecked" type="checkbox" style="display: none" >
<label>
<span>
<svg width="12px" height="10px" viewbox="0 0 12 10">
<polyline points="1.5 6 4.5 9 10.5 1"></polyline>
</svg>
</span>
<span>{{ label }}</span>
<template>
<svg class="donut">
<transition-group tag="g" name="circle" appear>
<circle
ref="circle"
v-for="(circle, i) in circles" :key="i"
:r="radius"
:stroke="colors[i]"
:stroke-dasharray="circle.dashArray"
:stroke-dashoffset="circle.dashOffset"
<?php
$domain = "example.com";
// Подключение к БД
$host = "";
$user = "";
$pass = "";
$db = "";
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access 7 days"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/html "access plus 7 day"
ExpiresByType text/x-javascript "access 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
placeholder(color)
&::-webkit-input-placeholder
color color
&:-moz-placeholder
color color
&::-moz-placeholder
color color
&:-ms-input-placeholder
color color
// Styles for autofilled inputs, textareas, selects
input:-webkit-autofill {
-webkit-text-fill-color black
-webkit-box-shadow 0 0 0px 100px white inset
}
// Подсветка элемента при тапе на мобилах
div {
-webkit-tap-highlight-color: transparent;
}
/**
* 1. Установить yaml-loader
* 2. Создать файл ~/locales/[name].yaml
*
* Содержимое файла
* About:
* ru: О нас
*/
import Vue from 'vue'
html {
line-height: 1.2;
text-decoration-skip: ink;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body,
p,
figure,