Skip to content

Instantly share code, notes, and snippets.

Gordon Franke gimler

View GitHub Profile
@gimler
gimler / Select2.php
Created Jan 9, 2020 — forked from tortuetorche/Select2.php
Select2 v3.5 helpers for the WebDriver module of Codeception 2.1 (WIP)
View Select2.php
<?php
namespace Helper;
// Select2 helpers for the jQuery based replacement for select boxes.
// See: http://select2.github.io/select2
// Author: Tortue Torche <tortuetorche@spam.me>
// License: MIT
//
// Installation:
// * Put this file in your 'tests/_support/Helper' directory
@gimler
gimler / tests_check_filename_match_class.sh
Created Jul 4, 2018
Simple bash script to find files where the class name not match the file name
View tests_check_filename_match_class.sh
find tests -name '*Test.php' -exec sh -c 'FILEPATH={}; FILE=${FILEPATH##*/}; FILEBASE=${FILE%.php}; if ! grep -q $FILEBASE $FILEPATH; then echo $FILEPATH \($FILEBASE\); fi' \;
View gist:7020118
$ export VAGRANT_LOG=debug; vagrant up ubuntu
INFO global: Vagrant version: 1.3.5
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/help/plugin.rb
INFO manager: Registered plugin: help command
View gist:5290246

We are testing a simple controller from imaginable MVC framework.

<?php
class UserController extends AbtractController {

    public function show($id)
    {
        $user = $this->db->find('users',$id);
        if (!$user) return $this->render404('User not found');
View ACLHelper.php
<?php
namespace WSL\BaseBundle\Util\Helper;
use Doctrine\ORM\Query;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Security\Acl\Permission\MaskBuilder;
/**
* Description of ACL
View memcached
#! /bin/bash
### BEGIN INIT INFO
# Provides: memcached
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: memcached - Memory caching daemon
@gimler
gimler / symfony1_find_missing_translation_strings.php
Created Aug 10, 2010
Find mising translations string for all or a given language in a symfony1 i18n folder.
View symfony1_find_missing_translation_strings.php
<?php
$pathToTranslationXMLFiles = 'lib/symfony/plugins/sfDoctrinePlugin/i18n';
// config null for all languages or a specific language e.g. de or fr
$myLang = null;
if (isset($argv[1]))
{
$myLang = $argv[1];
echo 'Use '.$myLang . PHP_EOL;
You can’t perform that action at this time.