Skip to content

Instantly share code, notes, and snippets.

# config.neon
extensions:
version: Clevis\Version\DI\VersionExtension
# config.local.neon
# config.local.sample.neon
version: [1]
@Mikulas
Mikulas / phpv.sh
Last active August 29, 2015 14:06
#!/bin/bash
c='\x1B[0;32m'
nc='\x1B[0m'
TARGET=/usr/local
LIST=`ls $TARGET | grep php | grep -v "php5$" | awk -F '-' '{print $3 "\t" $0}' | sort | awk '{print $2}'`
if [ "$#" -ne 1 ]; then
echo -e "Usage: $0 index\n"
/**
* @param command string
* @param args array
* @param cb callable(err, stdout, stderr)
*/
casper.system = function(command, args, cb) {
var childProcess;
try {
childProcess = require("child_process");
childProcess.execFile(command, args, null, cb);
casper.test.begin('Warn when registering with weak password', 5, function suite(test) {
casper.plink("//Auth:registration", {}, function(url) {
casper.start(url, function() {
var form = 'form[id="frm-registrationForm-form"]';
test.assertExists(form, "Registration form is found");
this.fill(form, {
password: "weak"
}, false);
test.assertExists('.has-warning [name="password"]', "Warn on weak password");
@Mikulas
Mikulas / zmq.api.php
Created August 19, 2014 08:24
PHP ZeroMQ Extension API for PhpStorm and other IDEs for autocomplete (zmq 4.0.4)
<?php
/**
* zmq-API v@PACKAGE_VERSION@ Docs build by DocThor [2014-08-19]
* @package zmq
*/
/**
* @package zmq
*/
class ZMQ {
/tmp ❯❯❯ sh ./test ⏎
Checking 139 applications...
The following applications will break in Gatekeeper on 10.9.5 and Yosemite:
/Applications/1Password.app
/Applications/Adobe Bridge CS6/Adobe Bridge CS6.app
/Applications/Adobe Extension Manager CS6/Adobe Extension Manager CS6.app
/Applications/Adobe Illustrator CS6/Adobe Illustrator.app
/Applications/Adobe Photoshop CS6/Adobe Photoshop CS6.app
/Applications/Boxer.app
/Applications/Dash.app
diff --git a/app/models/orm/FQNAnnotationMetaData.php b/app/models/orm/FQNAnnotationMetaData.php
index b14808b..94e8c2e 100644
--- a/app/models/orm/FQNAnnotationMetaData.php
+++ b/app/models/orm/FQNAnnotationMetaData.php
@@ -6,6 +6,7 @@ use Nette\Reflection\AnnotationsParser as NetteAnnotationsParser;
use Nette\Reflection\ClassType;
use Orm\AnnotationMetaDataException;
use Orm\AnnotationsParser;
+use Orm\Callback;
use Orm\IEntity;
@Mikulas
Mikulas / examples.php
Created July 5, 2014 18:13
php anonymous variable
<?php
$nums = [1, 2, 3, 4, 5];
list($a, _, $b) = $nums;
foreach ($nums as $num => _) { /* */ }
$fn = function(_, $out) {};
@Mikulas
Mikulas / orm-notes.md
Last active August 29, 2015 14:02
poznámky k nextras/orm

onCompile nekontroluje, jestli existuje class definovaná v config model

OrmExtension getRepositoryList nevaliduje anotace (source-class-Nextras.Orm.DI.OrmExtension.html#79)

OrmExtension createMapperService nevaruje pokud je v configu nastaven vlastní mapper, ale ta třída neexistuje. Místo toho to bez hlášky fallbackne na defaultní mapper.

Repository getEntityClassNames funguje jenom pro notaci např. User, UsersRepository. Např. na Foo\Users\User, Foo\Users\Repository to selže. Vůbec jsem narazil na to že většina úprav v orm spoléhá na nějaké notace a nekontroluje co vlastně substr maže.

Na Model mi chybí metoda flush.

<?xml version='1.0' encoding='UTF-8'?>
<entry
xmlns='http://www.w3.org/2005/Atom'
xmlns:app='http://purl.org/atom/app#'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:gd='http://schemas.google.com/g/2005'
xmlns:yt='http://gdata.youtube.com/schemas/2007'>
<id>http://gdata.youtube.com/feeds/api/videos/SBjQ9tuuTJQ</id>
<published>2009-10-03T04:29:24.000Z</published>
<updated>2014-06-16T12:11:43.000Z</updated>