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
<?php
public static function init($options = NULL) {
if(is_null($options) || !is_array($options)) return FALSE;
if(is_array(current($options))) {
foreach($options as $option) {
dibi::connect($option, self::CONNECTION . self::$connection++);
}
} else {
dibi::connect($options, self::CONNECTION . self::$connection++);
@tomaskavalek
tomaskavalek / uv.tex
Created January 7, 2011 11:53
Uvozovky CZE
\def\clqq{\vbox to0pt{\vss\hbox{\char34}\kern-1.4ex}}
\chardef\crqq=92
\def\uv #1{\leavevmode\clqq #1\crqq}
@tomaskavalek
tomaskavalek / jQuery_create_elements.html
Created January 24, 2011 18:06
jQuery create element demo.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="copyright" content="" />
<meta name="author" content="" />
<meta name="robots" content="all, follow" />
<meta name="googlebot" content="index, follow, snippet, archive" />
@tomaskavalek
tomaskavalek / NShrink.NFinder.php
Created January 27, 2011 10:54
NShrink and NFinder in action - "draft"
<!DOCTYPE html><link rel="stylesheet" href="files/style.css">
<h1>NShrink and NFinder in action</h1>
<pre>
<?php
// Temporarily solution
require dirname(__FILE__) . '/Finder.php52.php';
@tomaskavalek
tomaskavalek / infinity_port_read
Created January 28, 2011 10:25
Reading port in embed PC with worse Linux.
#!/bin/bash
# Nastaveni prenosu dat
stty -F /dev/ttyS1 raw speed 9600
# Smycka
while [ 1 ]; do
READ=`dd if=/dev/ttyS1 count=1`
echo $READ
done
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
@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
@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 / 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 / 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)) {