Skip to content

Instantly share code, notes, and snippets.

View mishak87's full-sized avatar

Michal Gebauer mishak87

View GitHub Profile
<?php
class BcmathCalculator extends Nette\Object implements ICalculator
{
/** @var int */
private $scale;
<?php
/** @Entity */
class Product {
/** @Column */
protected $code;
/** @OneToMany(ProductPricemap) */
protected $prices;
}
@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;
@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 / list.md
Last active December 20, 2015 11:19
List of useful bootstrap controls
@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 {
<?php
namespace ApiModule;
use Api\Authenticator,
Model\Rest,
Model\Action,
Mishak\Application\Response\JsonResponse,
Nette,
Nette\Application\UI\Presenter,
@mishak87
mishak87 / crypsy-chat-ignore.js
Created July 14, 2013 04:28
Ignore people in chat
var blacklist = ['mishak','mullick'];
setInterval(function () {
$('#chatcontent > div').each(function(i,v){if(-1!=$.inArray($('span', v).text(), blacklist))$(v).hide();});
}, 1000);
@mishak87
mishak87 / BirthNumber.cs
Last active May 6, 2021 07:42
C# class for simple checking of birth number validity with some useful parameters. C# třída pro práci a validaci rodného čísla s pár užitečnými parametry.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.Runtime.Serialization;
namespace net.mishak.utils
{