This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns trees.core) | |
(require '[clojure.contrib.math :as math]) | |
(use 'clojure.set) | |
; tools | |
(defn | |
^{:doc "get column from 2 dimensional array" | |
:test (fn [] | |
(assert (= [0 1 2] (get-column [[2 0] [3 1] [1 2]] 1))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Singleton | |
{ | |
private static Singleton inst; | |
public Singleton (String password) | |
{ | |
if (!password.equals("tajne heslo")) { | |
throw new Exception("Nemuzes vyrobit instanci :-P"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# použití #} | |
{# import makra, snad by to stačilo jednou v nějakém layoutu #} | |
{% from 'JmNecoBundle::macros.html.twig' import class_attr %} | |
{% set dataZDatabaze = ['prvni', 'druhy', 'treti', 'ctvrty', 'paty'] %} | |
<ul> | |
{% for item in dataZDatabaze %} | |
<li{{ class_attr({'lichy': loop.index is odd, 'posledni': loop.last}) }}>{{ item }}</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class OfferFinder extends Blabla | |
{ | |
public function whereTags(array $tags) | |
{ | |
if (count($tags) === 0) { | |
return; | |
} | |
$ids = array_map(function ($tag) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This file is part of the Nette Framework (http://nette.org) | |
* | |
* Copyright (c) 2004, 2011 David Grudl (http://davidgrudl.com) | |
* | |
* For the full copyright and license information, please view | |
* the file license.txt that was distributed with this source code. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface ITest { | |
} | |
class TestClass1 { | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Symfony\Component\Validator\Constraints; | |
/** | |
* @author Roman Sklenář, Jan Marek | |
* @link https://gist.github.com/664454 | |
*/ | |
class Unique extends \Symfony\Component\Validator\Constraint | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// alt-shift zmena klavesnice EN->CS (QWERTY) | |
// ctrl-space code hints | |
// nekdo to spustte. nevime co to dela | |
namespace { | |
$users = array(); | |
$val = isset($_GET['lorem']) ? intval($_GET['lorem']) : 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Webloader; | |
use Nette\String, lessc; | |
/** | |
* Less CSS filter | |
* | |
* @author Jan Marek |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Neuron; | |
use Nette\Environment, Nette\String; | |
use Nette\NeonParser; | |
use Nette\Reflection\ClassReflection; | |
use Nette\IContext; | |
/** |