Skip to content

Instantly share code, notes, and snippets.

View mishak87's full-sized avatar

Michal Gebauer mishak87

View GitHub Profile
@mishak87
mishak87 / protected-function-class.php
Created July 29, 2013 13:54
PHP witch craft at its best?
<?php
class A {
public function callProtectedFunctionOfInstanceOfClassDescendant()
{
echo (new B)->protectedFunction();
}
}
class B extends A {
@mishak87
mishak87 / list.md
Last active December 20, 2015 11:19
List of useful bootstrap controls
@mishak87
mishak87 / TableFactory.php
Last active December 20, 2015 18:09
Now I feel really stupid
<?php
use Nette;
class TableFactory extends Nette\Object
{
/** @var Nette\Database\Connection */
@mishak87
mishak87 / Rixxi\Utils\Batch.php
Created August 20, 2013 22:08
I was tired of writing the same batch code all over again. At some point in the future this will be part of rixxi/basics or not...
<?php
namespace Rixxi\Utils;
class Batch implements \ArrayAccess
{
/** @var int */
private $limit;
<?php
/** @Entity */
class Product {
/** @Column */
protected $code;
/** @OneToMany(ProductPricemap) */
protected $prices;
}
<?php
class BcmathCalculator extends Nette\Object implements ICalculator
{
/** @var int */
private $scale;
@mishak87
mishak87 / editor.reg
Created September 16, 2013 21:10
Nette tool to ease up pain from errors (bind to editor: protocol via reg) PHPStorm and with fallback to Sublime Text
REGEDIT4
[HKEY_CLASSES_ROOT\editor]
@="URL:editor Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\editor\shell\open\command]
@="wscript \"C:\\bin\\scripts\\run-editor.js\" \"%1\""
@mishak87
mishak87 / librarian-puppet-win.md
Last active November 24, 2016 04:18
Howto install puppet and librarian-puppet on Win 7
ko.extenders.url = function (target, option) {
var value = $.address.parameter(option);
if (value) {
target(value);
}
target.subscribe(function (value) {
$.address.parameter(option, value);
});