Skip to content

Instantly share code, notes, and snippets.

@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 / AjaxComment.php
Last active May 3, 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 / 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 / wordpress_ant.xml
Created Jan 25, 2011
Wordpress Apache ANT script
View wordpress_ant.xml
<?xml version="1.0" encoding="UTF-8"?>
<project basedir=".">
<property name="mysql" value="c:\Program Files\wamp\bin\mysql\mysql5.5.8\bin\" description="path to Mysql"/>
<property name="yuicompressor" value="c:\Program Files\yuicompressor-2.4.2\build\yuicompressor-2.4.2.jar" description="Path to yuicompressor-2.4.2.jar"/>
<property name="database" value="wp" description="Local database name"/>
<property name="url.production" value="http://www.blogs.com/wp" description="Production URL" />
<property name="url.local" value="http://localhost/blog" description="Local url" />
@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"
@OzzyCzech
OzzyCzech / t-mobile.md
Last active Jun 13, 2016
Únik osobních dat T-mobile
View t-mobile.md

Českému T-mobile uniklo 1,5 milionu osobních dat jejich zákazníků, tento únik se může týkat také Vašich osobních dat.

https://www.t-mobile.cz/podpora/kontaktujte-nas

Dobrý den,

jsem velmi znepokojen únikem osobních dat 1,5 milionů zákazníků
T-mobile a toto pochybení považuji za dostatečný důvod k ukončení smlouvy.
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);
You can’t perform that action at this time.