Skip to content

Instantly share code, notes, and snippets.

View Tusko's full-sized avatar

Tusko Trush Tusko

View GitHub Profile
@Tusko
Tusko / mono-pakunok-maluka.php
Created October 19, 2024 11:02
Оплата картою пакунок малюка для monobank
<?php
// morkva-monopay extension
add_action('woocommerce_checkout_create_order', 'add_cheque_metadata', 10, 2);
function add_cheque_metadata($order, $data) {
if($order->get_payment_method() === 'cheque') {
$order->update_meta_data('_pakunok_maluka', 'yes');
$order->save();
}
}
@Tusko
Tusko / wordpress-wp-fastest-cache.stpl
Created May 19, 2024 13:42
Hestia Nginx/PHP-FPM for WP Fastest Cache
#=========================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
# https://hestiacp.com/docs/server-administration/web-templates.html #
#=========================================================================#
server {
listen %ip%:%web_ssl_port% ssl;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
export const getThumbnail = (id, size = 300) =>
`https://drive.google.com/thumbnail?id=${id}&sz=${size}`;
export const getIcon = (mimeType) =>
`https://drive-thirdparty.googleusercontent.com/256/type/${mimeType}`;
export const getFile = (id) => `https://drive.google.com/uc?id=${id}`;
const downloadFile = (id) =>
@Tusko
Tusko / replace-user.sh
Created December 8, 2023 12:04
GIT change all commit author's email
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@Tusko
Tusko / checkbox.scss
Last active September 26, 2023 13:45
css checkbox
.input-checkbox {
border : 1px solid map-get($colors, 'ocean');
position : relative;
transition-duration : 200ms;
-webkit-appearance : none;
appearance : none;
width : 24px;
height : 24px;
&::after {
transition-duration : 100ms;
@Tusko
Tusko / readme.md
Created August 16, 2023 15:29
readme.md

Dev docs

Project setup

nvm use  # Switch node version to supported version *
yarn     # Install dependencies

* install nvm autoload Read more

@Tusko
Tusko / ssr-sitemap.js
Last active August 10, 2023 12:39
Vite Plugin SSR Sitemap
import { SitemapStream } from "sitemap";
import { createWriteStream } from "node:fs";
import { resolve } from "node:path";
export function ssrSitemap(opts) {
const pages = new Set();
let config;
let hasVitePlusinSSR = false;
const defaultOtps = {
@Tusko
Tusko / .htaccess
Created May 5, 2023 08:13
Force SSL .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
@Tusko
Tusko / .zshrc
Created July 11, 2022 07:16
ZSH NVM autoswitch
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
@Tusko
Tusko / backdrop.css
Created June 13, 2022 07:50
blue background
.element {
backdrop-filter: saturate(50%) blur(8px);
-webkit-backdrop-filter: saturate(50%) blur(8px);
}