Skip to content

Instantly share code, notes, and snippets.

@MelkorNemesis
MelkorNemesis / ControlMultiplier.php
Created November 26, 2011 15:15 — forked from fprochazka/ControlMultiplier.php
Ajax friendly ControlMultiplier
<?php
/**
* Component multiplier.
*/
class ControlMultiplier extends Nette\Application\UI\Control
{
/** @var Nette\Callback */
private $factory;
<?php
public static function renderSnippets($control, $local, $params)
{
$control->snippetMode = FALSE;
$payload = $control->getPresenter()->getPayload();
if (isset($local->blocks)) {
foreach ($local->blocks as $name => $function) {
if ($name[0] !== '_' || !$control->isControlInvalid(substr($name, 1))) {
continue;
}
<?
public static function renderSnippets($control, $local, $params)
{
$control->snippetMode = FALSE;
$payload = $control->getPresenter()->getPayload();
if (isset($local->blocks)) {
foreach ($local->blocks as $name => $function) {
if ($name[0] !== '_' || !$control->isControlInvalid(substr($name, 1))) {
continue;
}
@MelkorNemesis
MelkorNemesis / gist:2048002
Created March 16, 2012 01:01 — forked from Kambfhase/gist:1175651
JS Class Libs( and Articles)
http://code.google.com/p/es-lab/wiki/Traits
http://webreflection.blogspot.com/2010/01/es5-es5-classes-as-descriptor-objects.html
http://javascript.crockford.com/prototypal.html
http://jsclass.jcoglan.com/
http://ejohn.org/blog/simple-javascript-inheritance/
https://github.com/Kambfhase/Din
http://github.com/tobeytailor/def.js
http://mootools.net/docs/core/Class/Class
http://github.com/polvero/klass
http://github.com/Joose/Joose
@MelkorNemesis
MelkorNemesis / ble
Created December 7, 2012 00:32 — forked from anonymous/ble
<script type="text/javascript">
function remove(id) {if (confirm("Jste si jisti?")) window.location = "primar.php?m=lekari&s=vymazat&i=" + id; }
</script>
<?php
$vys=mysql_query('SELECT * FROM osetrujici LEFT JOIN uvazek ON rodne_cislo LIKE osetrujici WHERE jmeno like "%'.$fjm.'%" AND prijmeni like "%'.$fpr.'%"
AND rodne_cislo like "%'.$fro.'%" AND (oddeleni LIKE "%'.$fod.'%" OR oddeleni IS NULL) AND active=true GROUP BY rodne_cislo ORDER BY prijmeni;');
if ($vys==false) die('Invalid query: '.mysql_error());
while ($row = mysql_fetch_row($vys)) {
if ($row[8] == NULL && strlen($fod)) continue;
SELECT articles_params.*,articles.*
FROM `articles_params` LEFT JOIN articles ON articles_params.articles_id = articles.id
WHERE articles.sections_id = 1 AND articles_params.name LIKE "černé" AND articles_params.name LIKE "dlouhé"
SELECT * FROM articles a
JOIN articles_params ap ON a.id = ap.articles_id
JOIN params p ON ap.params_id = p.id
WHERE a.sections_id = 1 AND EXISTS (
SELECT * FROM articles_params _ap
javascript: function labelAttacks() {
var arrInputs = document.getElementsByTagName('input');
var txtAttack = "Útok";
var strDate = document.getElementById('serverDate').childNodes[0].nodeValue;
strDate = strDate.substring(0, strDate.length - 5);
var strTime = document.getElementById('serverTime').childNodes[0].nodeValue;
var j = 0;
jmeno = '[' + strDate + ' ' + strTime + ']';
$("#incomings_table tr:gt(0)").each(function () {
if($(this).find(":contains('"+txtAttack+"')")){
<?php
ob_start(function($s, $flag) {
if ($flag & PHP_OUTPUT_HANDLER_START) {
$e = new \Exception;
$s = nl2br("Output started here:\n{$e->getTraceAsString()}\n\n") . $s;
}
return $s;
}, 2);
# ============================================================
# PluginName v0.0.0
# http://URL
# ============================================================
# Copyright 2012 The Beans Group
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#