Skip to content

Instantly share code, notes, and snippets.

View oaltman's full-sized avatar

Ondřej Altman oaltman

  • Emplifi
  • Pilsen, Czech Republic
View GitHub Profile
@oaltman
oaltman / otazky
Last active December 17, 2015 00:29
SAP test
1. Jakými instrukcemi v jazyce symbolických instrukcí (asembleru) můžete měnit pořadí provádění instrukcí?
Podmíněný skok
Nepodmíněný skok
Skok do podprogramu (typicky call)
/**
* @Route("/{model}", name="model_view")
* @Template()
*/
public function viewAction($model)
{
/** @var EntityManager $entityManager */
$entityManager = $this->getDoctrine()->getManager();
/** @var RoomModel $model */
$model = $entityManager
/**
* @Route("/{room}/new", name="model_new")
* @Template()
*/
public function newAction(Request $request,$room)
{
$form = $this->createForm(new RoomModelType(), new RoomModel());
if($request->isMethod('POST'))
{
class CTable {
public:
CTable();
~CTable();
void insert(std::vector<std::pair<std::string,CColumn*> > params);
void select(std::string column);
void deleteRows(std::vector<int> rows);
void printRows(std::vector<int> rows, std::vector<std::string> columns);
void insertRows(std::vector<std::string> values);
std::vector<int> findBy(std::string column, std::string value);
@oaltman
oaltman / gist:6098247
Last active December 20, 2015 08:09
Spuštění build-in serveru a prohlížeče z terminálu (na pozadí)
# ~/.bashrc
# Spusti php built-in server a otevre prohlizec
function psrv() {
PORT=8888
ADDRESS='localhost'
BROWSER="chromium-browser"
[[ -n "$1" ]] && PORT=$1
[[ -n "$2" ]] && ADDRESS=$2
[[ -n "$3" ]] && BROWSER=$3
public function testFormattingDatesBasedOnConfig()
{
$stub = $this->getMock('Henry\Config',array('get'));
$stub->expects($this->any())
->method('get')
->will($this->returnValue('c'));
$formatter = new DateFormatter($stub);
$this->assertEquals('c',$stub->get('param'));
@oaltman
oaltman / gist:6104190
Created July 29, 2013 13:09
Fix na deprecated
$form->addTextarea("text", NULL)
->setAttribute('rows', 20)
->setAttribute('cols',60)
->getControlPrototype()->class("texyla");
function .() {
set +o monitor
PORT=8888
ADDRESS='localhost'
BROWSER="chromium-browser"
[[ -n "$1" ]] && PORT=$1
[[ -n "$2" ]] && ADDRESS=$2
[[ -n "$3" ]] && BROWSER=$3
CURRENT=`pwd`
[[ ! -f "index.php" ]] && cd www
<?php
/**
* User: henry, Date: 7/31/13,Time: 12:11 AM
*/
namespace App;
use Nette\Application\UI\Form;
class ArticleForm extends Form
class BaseEntity extends IdentifiedEntity {
public function __construct($data = NULL)
{
parent::__construct();
if($data)
$this->setData($data);
}
public function setData($data)