Instantly share code, notes, and snippets.

View DateTime.php
namespace MyNamespace;
$date = new ADateTime('2018-03-28');
$date->sub(new \DateInterval('P1M'));
echo $date->format('Y-m-d') . "\n";
View jQuery.stringify.js
* converted stringify() to jQuery plugin.
* serializes a simple object to a JSON formatted string.
* Note: stringify() is different from jQuery.serialize() which URLEncodes form elements
* Added a fix to skip over Object.prototype members added by the prototype.js library
* jQuery.ajax({
View Com.latte
{* Component template *}
<div style="border-style: solid; border-width: 1px;">
<p>Jméno komponenty: {$control->name}</p>
{snippet com}
<p>Čas vykreslení:{$time|date:'%H:%M:%S'}</p>
<p><a n:href="refresh!" class="ajax">REFRESH (invalidování)</a></p>
View ghost-element-vertical-align.css
/* This parent can be any width and height */
.block {
text-align: center;
/* May want to do this if there is risk the container may be narrower than the element inside */
white-space: nowrap;
/* The ghost, nudged to maintain perfect centering */
.block:before {
View BasePresenter.php
* @author Filip Procházka <>
abstract class BasePresenter extends Nette\Application\UI\Presenter
* @var \Img\ImagePipe
View autosave.js
var AutoSave = (function(){
var timer = null;
function getEditor(){
var elems = document.getElementsByTagName("textarea")
if (elems.length <= 0)
return null;
View autosave.js
$(document).ready(function() {
// Recovery Below
// Retrieve the object from storage onReady
var autosave = localStorage.getItem('file');
View NetteCsvResponse.php
namespace Nette\Application\Responses;
use Nette;
* CSV download response.
* Under New BSD license.