Skip to content

Instantly share code, notes, and snippets.

Timba64 timba64

Block or report user

Report or block timba64

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@timba64
timba64 / function.php
Last active Sep 10, 2019 — forked from nandomoreirame/function.php
WordPress REST API send email SMTP in with PHPMailer
View function.php
<?php
function sendWithPhpMailer($subject, $body, $reply) {
require(ABSPATH . WPINC . '/class-phpmailer.php');
require(ABSPATH . WPINC . '/class-smtp.php');
// date_default_timezone_set( 'America/Sao_Paulo' );
$blogname = wp_strip_all_tags( trim( get_option( 'blogname' ) ) );
$smtpHost = wp_strip_all_tags( trim( get_option( 'smtp_host' ) ) );
@timba64
timba64 / sql_query_levelchinese.txt
Created Apr 25, 2019
Some sql gueries for memory
View sql_query_levelchinese.txt
1. ********* step 1
CREATE TABLE `levelchinese`.`temp_usermeta` (
`umeta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`meta_key` varchar(255) DEFAULT NULL,
`meta_value` longtext,
PRIMARY KEY (`umeta_id`),
KEY `user_id` (`user_id`),
KEY `meta_key` (`meta_key`(191))
@timba64
timba64 / kinsta-share-users.php
Created Apr 24, 2019 — forked from carlodaniele/kinsta-share-users.php
A plugin to share users and usermeta tables between independent WordPress installations. This plugin requires CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE defined into wp-config file
View kinsta-share-users.php
<?php
/**
* @package Kinsta_Share_Users
* @version 1.0
*/
/*
Plugin Name: Kinsta Share Users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin for Kinsta blog readers
Author: Carlo Daniele
@timba64
timba64 / indo_favicon.html
Created Jan 12, 2019
рекомендованная фавиконка
View indo_favicon.html
<!-- Стандартный фавикон -->
<link rel="icon" type="image/x-icon" href="https://example.com/favicon.ico">
<!-- Рекомендованный формат фавикона -->
<link rel="icon" type="image/png" href="https://example.com/favicon.png">
@timba64
timba64 / pie.js
Created Oct 30, 2018
Using Enhansed Ecommerce in Google Analytics
View pie.js
// get elements and push click in google Analitics
(function(){
var elems = document.querySelectorAll('.wcat-item');
for (var i = 0; i < elems.length; i++) {
elems[i].addEventListener('click', function(e){
var elName = this.querySelector('.name').textContent;
var elId = this.querySelector('.name').getAttribute('data-id');
var elPrice = parseInt(this.querySelector('.woocommerce-Price-amount').textContent);
//e.preventDefault();
dataLayer.push({
@timba64
timba64 / .cpanel.yml
Created Oct 26, 2018
Deployment site in cPanel of hoster.by
View .cpanel.yml
---
deployment:
tasks:
- export REPOPATH=/home/abram/testogit/*
- export SITEPATH=/home/abram/testo.domen.by/
- /bin/rsync -rav --exclude '.git' --exclude '.cpanel.yml' --del $REPOPATH $SITEPATH
@timba64
timba64 / popup.js
Created Oct 24, 2018
maintenance of popup window with form
View popup.js
// maintenance of popup
(function(){
// open popup link ***********************/
var bopy = $('.bibop');
$('#pop-js').on('click touchend', function(e) {
bopy.css('display', 'block').show().animate({ opacity: 1 }, 350);
e.preventDefault();
});
// popUp with form ***********************/
@timba64
timba64 / code.js
Last active Nov 26, 2018
Create custom menu in google spreadsheet, get unread email from google account and put it in google sheets
View code.js
function onOpen(e) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.addMenu("Меню для Оли",
[{ name: "Write to file", functionName: "writeToFile" },
{ name: "Remove Duplicates", functionName: "removeDuplicates" },
{ name: "Count lids", functionName: "countLids" }]
);
}
/**
@timba64
timba64 / func-help.php
Last active Jul 17, 2018
add page Help in menu in admin area of wordpress
View func-help.php
add_action('admin_menu', function(){
add_menu_page( 'Myway | Помощь', 'Помощь', 'edit_pages', 'help', 'add_help_page', 'dashicons-editor-help', 4 );
} );
function add_help_page() {
include 'helpix.php';
}
@timba64
timba64 / functions.php
Last active Oct 26, 2018
some functions for Wordpress
View functions.php
//add styles only on one page of admin area Wordpress
add_action( 'admin_enqueue_scripts', 'add_css_help_page' );
function add_css_help_page( $hook ){
//wp_die($hook);
// output help.css only on help page in admin zone
if($hook != 'toplevel_page_help') {
return;
}
wp_enqueue_style( 'css-help-admin', get_template_directory_uri() .'/help.css' );
}
You can’t perform that action at this time.