Skip to content

Instantly share code, notes, and snippets.

namespace Maui.Controls.Sample;
public class GraphicsDrawable(Microsoft.Maui.Graphics.IImage[] images) : IDrawable
{
public void Draw(ICanvas canvas, RectF dirtyRect)
{
// 3x3 matrix composed of 100x100 images. The number of images is always 9.
for (int i = 0; i < images.Length; i++)
{
int row = i / 3;
@MartyIX
MartyIX / nette-select-optgroup.php
Created August 19, 2014 06:12
Nette\Forms\Controls\SelectBox - <optgroup>
<?php
$countries = array(
'eu' => array(
'cs' => 'Cesko',
'sk' => 'Slovensko',
),
'en' => 'USA'
);
@MartyIX
MartyIX / return-type-hint
Created May 25, 2014 10:45
return type hint
<?php
class A {
/**
* @return self
*/
public function someMethod() {
return $this;
}
@MartyIX
MartyIX / live-form-validation.js
Created October 6, 2011 16:29 — forked from redhead/live-form-validation.js
Live Form Validation for Nette 2.0
/**
* Live Form Validation for Nette 2.0
*
* @author Radek Ježdík, David Grudl
* @license New BSD License
*/
var LiveForm = {
options: {
controlErrorClass: 'form-control-error',
@MartyIX
MartyIX / grinder-example.php
Created July 1, 2011 14:40
Grinder PHP Nette
<?php
protected function createComponentGrinder()
{
$model = new Grinder\Models\DibiFluentModel($this->getModel('orders')->getFluentForYourEvents());
$grid = new Grinder\Grid($model);
$grid->setRenderer(new Grinder\Renderers\TableRenderer);
// if not present then $this->session is not initialized in grid.php and you'll get an exception
$grid->setUpProtection($this->getSession());