Skip to content

Instantly share code, notes, and snippets.

Avatar
👋
Hi there...

Roman Ožana OzzyCzech

👋
Hi there...
View GitHub Profile
@OzzyCzech
OzzyCzech / musicbrainz-picard-renaming.md
Last active Jun 8, 2021
Musicbrainz Picard Renaming script
View musicbrainz-picard-renaming.md

$if($eq($left($if2(%albumartist%,%artist%),4),The ),$left($right($if2(%albumartist%,%artist%),$sub($len($if2(%albumartist%,%artist%)),4)),1),$left($if2(%albumartist%,%artist%),1))/$if2(%albumartist%,%artist%)/$if(%date%,$left(%date%,4) - )%album%/$num(%tracknumber%,2). %title% - %artist%

@OzzyCzech
OzzyCzech / AjaxComment.php
Last active Nov 11, 2020
Wordpress comment AJAX send
View AjaxComment.php
<?php
namespace zdrojak\comments;
/**
* Odeslani komentaru pomoci Ajaxu
*
* @author Roman Ozana <ozana@omdesign.cz>
*/
class AjaxComnment {
@OzzyCzech
OzzyCzech / BLACK.css
Last active Jun 15, 2020
Diarly dark THEME
View BLACK.css
.app {
foreground: #dee2e6;
header-color: #f0f4f7;
bold-color: #dee2e6;
link-color: #2c8ad3;
background: #282c34;
syntax: #CCCCCC;
@OzzyCzech
OzzyCzech / ftp.php
Created May 29, 2011
FTP Connection
View ftp.php
<?php
/**
* Generuje ID FTP pripojeni na zaklade zadane URL
* ftp://username:password@sld.domain.tld:21/path1/path2/
*/
function getFtpConnection($uri)
{
preg_match("/(?P<protocol>ftps?:\/\/)(?P<username>.*?):(?P<password>.*?)@(?P<url>.*?):?(?P<port>[1-9]+)?(?<dir>\/.*)/i", $uri, $match);
$conn = ftp_connect($match['url'], empty($match['port']) ? 21 : (int)$match['port']) or die("Couldn't connect to " . $match['url']);
@OzzyCzech
OzzyCzech / gallery.php
Last active Aug 1, 2018
Wordpress responsive photo gallery with Twitter Boostrap 4
View gallery.php
@OzzyCzech
OzzyCzech / Presenter.php
Created Oct 2, 2011
Nativní Gettext translator v Nette
View Presenter.php
<?php
namespace Base;
use Nette\Environment;
abstract class Presenter extends \Nette\Application\UI\Presenter
{
/** @persitent */
public $lang;
@OzzyCzech
OzzyCzech / apple.opml
Last active Jan 17, 2017
OPML list of Google blogs
View apple.opml
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Apple</title>
</head>
<body>
<outline text="Apple" title="Apple">
<outline type="rss" text="MacRumors: Mac News and Rumors - Front Page" title="MacRumors: Mac News and Rumors - Front Page" xmlUrl="http://www.macrumors.com/macrumors.xml" htmlUrl="http://www.macrumors.com"/>
<outline type="rss" text="Cult of Mac" title="Cult of Mac" xmlUrl="http://feeds.feedburner.com/cultofmac/bFow" htmlUrl="http://www.cultofmac.com"/>
@OzzyCzech
OzzyCzech / index.html
Last active Jul 25, 2016
Pure CSS / HTML timeline
View index.html
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet/less" type="text/css" href="timeline.less"/>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/less.js/1.4.1/less.min.js"></script>
<script type="text/javascript">
less = {
env: "development", // or "production"
View convert.php
<?php
$data = json_decode(file_get_contents(__DIR__ . '/currency.json'));
$code = var_export((array)$data, true);
// add gettext function call
$code = preg_replace("/'name' => '(.+)'/", "'name' => __('$1')", $code);
$code = preg_replace("/'name_plural' => '(.+)'/", "'name' => __('$1')", $code);
// save PHP code
$code = "<?php\n return " . preg_replace('/stdClass::__set_state/', '(object)', $code) . ';';
file_put_contents(__DIR__ . '/currencies.locale.php', $code);