Skip to content

Instantly share code, notes, and snippets.

View Insayt's full-sized avatar
🏠
Working from home

Alex Insayt Insayt

🏠
Working from home
  • Rostov-on-Don
View GitHub Profile
!function(b,m){"use strict";(new function(){var s=function(e,n){return e.replace(/\{(\d+)\}/g,function(e,t){return n[t]||e})},u=function(e){return e.join(" - ")};this.i=function(){var e,t=m.querySelectorAll(".share-btn");for(e=t.length;e--;)n(t[e])};var n=function(e){var t,n=e.querySelectorAll("a");for(t=n.length;t--;)r(n[t],{id:"",url:c(e),title:i(e),desc:a(e)})},r=function(e,t){t.id=l(e,"data-id"),t.id&&o(e,"click",t)},c=function(e){return l(e,"data-url")||location.href||" "},i=function(e){return l(e,"data-title")||m.title||" "},a=function(e){var t=m.querySelector("meta[name=description]");return l(e,"data-desc")||t&&l(t,"content")||" "},o=function(e,t,n){var r=function(){p(n.id,n.url,n.title,n.desc)};e.addEventListener?e.addEventListener(t,r):e.attachEvent("on"+t,function(){r.call(e)})},l=function(e,t){return e.getAttribute(t)},h=function(e){return encodeURIComponent(e)},p=function(e,t,n,r){var c=h(t),i=h(r),a=h(n),o=a||i||"";switch(e){case"fb":d(s("https://www.facebook.com/sharer/sharer.php?u={0}",[c]),n)
# Если в логи пишется таймштамп, то при выводе логов не очень удобно - пример ниже, как можно отформатировать дату
cat file.log|perl -pe'use POSIX qw(strftime);s/^\[(\d+)\]/strftime("%Y-%m-%d %H:%M:%S",localtime $1\/1000)/e'
<?php
// Helpers here serve as example. Change to suit your needs.
const VITE_HOST = 'http://localhost:5133';
// For a real-world example check here:
// https://github.com/wp-bond/bond/blob/master/src/Tooling/Vite.php
// https://github.com/wp-bond/boilerplate/tree/master/app/themes/boilerplate
// you might check @vitejs/plugin-legacy if you need to support older browsers
// https://github.com/vitejs/vite/tree/main/packages/plugin-legacy