Skip to content

Instantly share code, notes, and snippets.

View Kedrigern's full-sized avatar

Ondřej Profant Kedrigern

View GitHub Profile
@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"
#!/usr/bin/env bash
# usage: ./check.sh *.csv
# Check if given csv have correct format for currency.
col_money="4 6"
col_date="17 18 19 20"
lines="2 3 4"
for f in $@; do
if file "$infile" | grep "UTF-8"; then
@Kedrigern
Kedrigern / HomepagePresenter.php
Last active March 26, 2016 09:20
Multiple file upload for Nette framework via HTML5 FormData (Ajax).
<?php
/**
* Homepage presenter.
*/
class HomepagePresenter extends BasePresenter
{
public function handleProcessImages()
{
$files = $this->getHttpRequest()->getFiles();
@Kedrigern
Kedrigern / @layout.latte
Last active April 7, 2016 19:25
Modální okna vyplňována dynamicky AJAXem bez JS kodu :)
{**
* My Application layout template.
*
* @param string $basePath web base path
* @param string $robots tell robots how to index the content of a page (optional)
* @param array $flashes flash messages
*}
<!DOCTYPE html>
<html>