Skip to content

Instantly share code, notes, and snippets.

View Kcko's full-sized avatar
🦜
fly like a bird ...

Kcko

🦜
fly like a bird ...
View GitHub Profile
@Kcko
Kcko / betterxml.function.php
Created October 21, 2018 11:48 — forked from jonathonbyrdziak/betterxml.function.php
Extending the SimpleXMLElement
<?php
/**
* Giving myself more functionality over this bit
*
* @author byrd
*
*/
class BetterXML extends SimpleXMLElement
{
/**
@Kcko
Kcko / curl.md
Created October 8, 2018 10:47 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@Kcko
Kcko / DateTime.php
Last active May 25, 2018 16:14 — forked from 66Ton99/DateTime.php
DateTime
<?php
namespace MyNamespace;
$date = new ADateTime('2018-03-28');
$date->sub(new \DateInterval('P1M'));
echo $date->format('Y-m-d') . "\n";
@Kcko
Kcko / jQuery.stringify.js
Created May 11, 2018 14:48 — forked from chicagoworks/jQuery.stringify.js
jQuery.stringify() utility
/**
* 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
* UPDATES:
* Added a fix to skip over Object.prototype members added by the prototype.js library
* USAGE:
* jQuery.ajax({
@Kcko
Kcko / Com.latte
Created April 17, 2018 20:02 — forked from Kedrigern/Com.latte
Nette: Ajaxové ovládání komponenty
{* Component template *}
<div style="border-style: solid; border-width: 1px;">
<h4>Komponenta</h4>
<p>Jméno komponenty: {$control->name}</p>
{snippet com}
<p>Čas vykreslení:{$time|date:'%H:%M:%S'}</p>
{/snippet}
<p><a n:href="refresh!" class="ajax">REFRESH (invalidování)</a></p>
</div>
/* 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 {
@Kcko
Kcko / BasePresenter.php
Created February 1, 2018 19:19 — forked from fprochazka/BasePresenter.php
Image pipe for #nettefw templates
<?php
/**
* @author Filip Procházka <filip@prochazka.su>
*/
abstract class BasePresenter extends Nette\Application\UI\Presenter
{
/**
* @var \Img\ImagePipe
@Kcko
Kcko / autosave.js
Created July 12, 2017 17:52 — forked from gcmurphy/autosave.js
Very simple autosave functionality using local storage
var AutoSave = (function(){
var timer = null;
function getEditor(){
var elems = document.getElementsByTagName("textarea")
if (elems.length <= 0)
return null;