Skip to content

Instantly share code, notes, and snippets.

View tomaskavalek's full-sized avatar
:octocat:
Hardworking anytime 👍

Tomáš Kavalek tomaskavalek

:octocat:
Hardworking anytime 👍
View GitHub Profile
@tomaskavalek
tomaskavalek / woocommerce-products-filter.php
Created February 23, 2019 12:01
WooCommerce Admin Custom Products Filtering
<?php
/**
* Return (render :-D) HTML Select > Option for filtering
*
* @param string $post_type
* @return void
*/
function webona_custom_product_filters(string $post_type): void
{
if ($post_type !== 'product') {
@tomaskavalek
tomaskavalek / howto.txt
Created February 12, 2019 13:01
PHP 7.x + Microsoft SQL Driver & Debian (stretch)
Firstly install https://warlord0blog.wordpress.com/2017/12/12/php7-0-microsoft-sql-driver-debian-stretch/
Then https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017
@tomaskavalek
tomaskavalek / gulpfile.js
Created January 25, 2019 08:50
Gulp 4 + Vagrant gulp.watch() fix
// Don't forget to use {usePolling: true}
// Without this options gulp under vagrant ignore file change in synced directory from your machine :-)
gulp.watch(path, {usePolling: true}, ['css']);
@tomaskavalek
tomaskavalek / wpscan.sh
Created October 15, 2018 07:42
wpscan with docker
docker pull wpscanteam/wpscan
docker run -i -t f80e1f599e05 /bin/bash --url https://www.example.com
@tomaskavalek
tomaskavalek / gopay_helper.php
Last active October 2, 2018 09:11
GopayHelper – replace mcrypt functions for PHP 7.2
<?php
public static function encrypt($data, $secureKey) {
return GopayHelper::encrypt_php72($data, $secureKey, 'DES-EDE3');
}
public static function decrypt($data, $secureKey) {
return GopayHelper::decrypt_php72($data, $secureKey, 'DES-EDE3');
}
/**
@tomaskavalek
tomaskavalek / wordpress_custom_archive_title.php
Last active September 5, 2018 01:57
Wordpress – Customize archive page title for selected post type
<?php
/**
* @param $title
* @return array
*/
function archive_titles($title): array
{
global $post;
if ( ! isset($post->post_type)) {
@tomaskavalek
tomaskavalek / functions.php
Last active August 28, 2018 07:32 — forked from fldtrace/functions.php
Better, Faster, Responsive Images for Divi – Upload in Divi child theme – with Divi Gallery module.
<?php
// enable divi functions
add_action( 'wp_enqueue_scripts', 'my_enqueue_assets' );
function my_enqueue_assets() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
//add 1440px image size
add_image_size('image_1440', 1440, 9999, false);
@tomaskavalek
tomaskavalek / keybase.md
Created August 22, 2017 10:39
keybase.md

Keybase proof

I hereby claim:

  • I am tomaskavalek on github.
  • I am kavalek (https://keybase.io/kavalek) on keybase.
  • I have a public key ASDOhiqFyA-D-9LPunwFQ2c4S5miQRJ9vuLHNDEHN63u3go

To claim this, I am signing this object:

@tomaskavalek
tomaskavalek / importtargz.sh
Last active August 14, 2017 05:20
Import tar.gz into MySQL (MariaDB)
tar xzOf dump.sql.tar.gz | mysql -u $user -p $database
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa