Skip to content

Instantly share code, notes, and snippets.

{
"name": "My Server",
"protocol": "sftp",
"context": "tortino.com.ua",
"uploadOnSave": true,
"profiles": {
"old": {
"host": "159.253.23.48",
"port": 22,
"username": "root",
@AndryWJ
AndryWJ / snackbar.css
Last active August 26, 2021 12:45
First show messages
#snackbar {
min-width: 250px;
transform: translateX(-50%);
background-color: #333;
color: #fff;
text-align: center;
border-radius: 2px;
padding: 16px;
position: fixed;
z-index: 9999999999999;
@AndryWJ
AndryWJ / js
Created April 21, 2021 17:54
custom widgets media file
/* eslint consistent-this: [ "error", "control" ] */
/**
* Continued from PHP Instructions on renaming / cloning image class.
* @link https://gist.github.com/StuffieStephie/4f654058545d693787a36e76d3521b1e
*
* Step 1:
* Assign previewTemplate variable to the script template ID defined in the
* PHP file sans 'tmpl-' (Step 6 of PHP instructions)
uasort($all_kuratorstvo, function($a, $b){ return strcmp($a['name'],$b['name']);});
@AndryWJ
AndryWJ / wp:php custom routing wordpress
Last active December 18, 2023 12:37
wp:php custom routing wordpress
add_filter( 'init', function(){
add_rewrite_rule(
'^bx24app/(.*)/?$',
'index.php?bx24app=$matches[1]',
'top'
);
add_filter( 'query_vars', function($vars){
$vars[] = 'bx24app';
return $vars;
});
https://www.digitalocean.com/community/tutorials/apache-ubuntu-14-04-lts-ru
<?php
/**
* The Template for displaying all single posts
*
* Template Name: Sber
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
@AndryWJ
AndryWJ / cloudSettings
Last active January 11, 2021 09:15
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-01-11T09:10:33.836Z","extensionVersion":"v3.4.3"}
function isClass(classs) {
var el = document.getElementsByClassName(classs);
if (el.length != 0) {
return true
}
return false;
}
@AndryWJ
AndryWJ / php: wpdb, PDO, SELECT,INSERT,UPDATE,DELETE CREATE
Last active January 18, 2019 11:04
php: wpdb, PDO, SELECT,INSERT,UPDATE,DELETE CREATE
// WPDB snipets
global $wpdb;
// SELECT выборка самых свежих записей
$var = 'CONFIRMED';
$sql = $wpdb->prepare( "SELECT `status`,`order_id`, timestamp( `timestamp` ) as 'timestamp_column'
FROM `payments`
WHERE `status` = 'CONFIRMED'
ORDER BY `timestamp_column` DESC", $var);