Skip to content

Instantly share code, notes, and snippets.

:octocat:
Hardworking anytime 👍

Tomáš Kavalek tomaskavalek

:octocat:
Hardworking anytime 👍
Block or report user

Report or block tomaskavalek

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
@tomaskavalek
tomaskavalek / woocommerce-products-filter.php
Created Feb 23, 2019
WooCommerce Admin Custom Products Filtering
View woocommerce-products-filter.php
<?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 Feb 12, 2019
PHP 7.x + Microsoft SQL Driver & Debian (stretch)
View howto.txt
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 Jan 25, 2019
Gulp 4 + Vagrant gulp.watch() fix
View gulpfile.js
// 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 Oct 15, 2018
wpscan with docker
View wpscan.sh
docker pull wpscanteam/wpscan
docker run -i -t f80e1f599e05 /bin/bash --url https://www.example.com
@tomaskavalek
tomaskavalek / gopay_helper.php
Last active Oct 2, 2018
GopayHelper – replace mcrypt functions for PHP 7.2
View gopay_helper.php
<?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 Sep 5, 2018
Wordpress – Customize archive page title for selected post type
View wordpress_custom_archive_title.php
<?php
/**
* @param $title
* @return array
*/
function archive_titles($title): array
{
global $post;
if ( ! isset($post->post_type)) {
@tomaskavalek
tomaskavalek / functions.php
Last active Aug 28, 2018 — forked from fldtrace/functions.php
Better, Faster, Responsive Images for Divi – Upload in Divi child theme – with Divi Gallery module.
View functions.php
<?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);
View 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 Aug 14, 2017
Import tar.gz into MySQL (MariaDB)
View importtargz.sh
tar xzOf dump.sql.tar.gz | mysql -u $user -p $database
View config
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
You can’t perform that action at this time.