Skip to content

Instantly share code, notes, and snippets.

View Kedrigern's full-sized avatar

Ondřej Profant Kedrigern

View GitHub Profile
@Kedrigern
Kedrigern / UploadManager.php
Created May 15, 2013 09:49
Implements PHP infrastructure for http://blueimp.github.io/jQuery-File-Upload in Nette FW.
<?php
use Nette\Utils\Finder;
/**
* @todo fake delete (delete to global trash)
*/
class UploadManager extends \Nette\Object
{
/** @var string upload dir */
@Kedrigern
Kedrigern / Formik.php
Created May 15, 2013 19:07
Volání submitu formuláře z jiného handle
<?php
use \Nette\Application\UI\Form;
class Formik extends Form
{
public function __construct()
{
parent::__construct();
@Kedrigern
Kedrigern / vcmi.sh
Last active December 17, 2015 12:19
vcmi installation script
#!/bin/bash
#==============================================================================
#
# FILE: homam-install.sh
#
# USAGE: homam-install.sh --data original_data [-v vcmi_version] dir
#
# DESCRIPTION: Installation script for vcmi
#
# AUTHOR: Ondřej Profant, ondrej.profant <> gmail.com
@Kedrigern
Kedrigern / NewList.php
Last active December 18, 2015 02:49
Verry simple grid for conrete app (no plans to extends to standalone component).
<?php
namespace BackendModule;
/**
* New List Control
*/
class NewList extends BaseControl
{
/**
@Kedrigern
Kedrigern / LocaleForm.php
Last active December 18, 2015 02:59
Lokalizace: repository, presenter, formuláře
<?php
namespace BackendModule;
class LocaleForm extends BaseForm
{
/** @var */
protected $repository;
/** @var */
@Kedrigern
Kedrigern / Column.php
Last active December 18, 2015 22:58
Just gist...
<?php
class Column extends \Nette\Object
{
/**
* @var string
*/
public $name;
/**
<?php
/**
* Homepage presenter.
*/
class HomepagePresenter extends BasePresenter
{
public function __construct(\Nette\Http\Session $session)
{
parent::__construct();
@Kedrigern
Kedrigern / dices.html
Last active December 24, 2015 07:09
Dices is really small app, which show using of knockout.js
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Dices</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="author" content="Ondřej Profant" />
</head>
@Kedrigern
Kedrigern / convert.sh
Created November 29, 2013 15:56
Syntax highlight and markdown via Pandox
#!/bin/bash
header="header.html.part"
for input in *.md; do
output="${input%.md}.html"
echo "input: $input output $output"
pandoc --no-highlight -o "$output" -H "$header" "$input"
@Kedrigern
Kedrigern / select.sql
Created March 29, 2014 22:54
DV view for data
SELECT *, md5(data) as md5, TRUNCATE(LENGTH(`data`)/1000,1) as "SIZE (kB)"
FROM `image`