Skip to content

Instantly share code, notes, and snippets.

View cognifloyd's full-sized avatar

Jacob Floyd cognifloyd

  • Garland, TX
  • 12:24 (UTC -06:00)
View GitHub Profile
@cognifloyd
cognifloyd / gist:6165529
Last active December 20, 2015 16:59
The first code snippet that I want to get working in my GSoC project.
<?php
$derivative = new Derivative( 'Cognifire.SweetSitePackage' );
$derivative->file('Resources/Private/TextTypo3.txt')->cloneFromBoilerplate('Cognifire.EmptyBoilerplate');
<?
$userFilterIsCallable = is_callable($userFilter)
/**
* Anonymous function to filter the DirectoryIterator's results
*
* @param $fileInfo \SplFileInfo Current file's FileInfo
* @param $pathname string Current file's path
* @param $iterator RecursiveCallbackFilterIterator
* @return boolean true if the current element is acceptable, otherwise false.
*/
<?
static public function readDirectoryRecursively($path, $suffix = NULL, $returnRealPath = FALSE, $returnDotFiles = FALSE, $followSymLinks = TRUE, /*callable*/ $userFilter = NULL, &$filenames = array()) {
if (!is_dir($path)) {
throw new Exception('"' . $path . '" is no directory.', 1207253462);
}
//by default FilesystemIterator has KEY_AS_PATHNAME|CURRENT_AS_FILEINFO|SKIP_DOTS
$directoryIterator = new \FilesystemIterator($path,$followSymLinks?\FilesystemIterator::FOLLOW_SYMLINKS:NULL);
$suffixLength = strlen($suffix);
$userFilterIsCallable = is_callable($userFilter);
@cognifloyd
cognifloyd / AcmeBuilder.php
Last active December 23, 2015 05:39
This should work.
<?
$bq = new BlobQuery('Acme.FooDerivativePackage');
$bq->from('Acme.BarBoilerplatePackage')
->integrateFiles(array(
'Resources/Private/Templates/FooBar.html' => 'Resources/Private/Templates/Baz.html'
)); // key is the file in the boilerplate, value is the file in the derivative.
// If only the value is given, then the file in the same location is copied from Boilerplate to Derivative.
/** @var $finder \Symfony\Component\Finder\Finder */
$bqfinder = $bq->getFinder();
@cognifloyd
cognifloyd / HackyTYPO3Directory.java
Created June 18, 2014 04:03
HackyTYPO3Directory
package org.typo3.sso.crowd;
//package com.atlassian.crowd.integration.directory.custom;//TODO: Should this be in the TYPO3 Namespace?
import com.atlassian.crowd.integration.authentication.PasswordCredential;
// https://docs.atlassian.com/atlassian-crowd/current/com/atlassian/crowd/embedded/api/PasswordCredential.html
import com.atlassian.crowd.integration.directory.InternalDirectory;
// https://docs.atlassian.com/atlassian-crowd/current/com/atlassian/crowd/directory/InternalDirectory.html
// https://docs.atlassian.com/atlassian-crowd/current/com/atlassian/crowd/directory/AbstractInternalDirectory.html
// implements InternalRemoteDirectory and RemoteDirectory
// https://docs.atlassian.com/atlassian-crowd/current/com/atlassian/crowd/directory/InternalRemoteDirectory.html
@cognifloyd
cognifloyd / Guardfile
Last active August 29, 2015 14:03
Guard + Guard-PhpUnit2 + TYPO3.Flow based application
# http://erichogue.ca/2012/09/php/continuous-testing-in-php-with-guard/
#Unit Tests
guard 'phpunit2',
:command => './bin/phpunit',
:cli => '-c Build/BuildEssentials/PhpUnit/UnitTests.xml',
#Important! No trailing slash!
:tests_path => Dir.glob('Packages/{Framework,Applications,Boilerplates}/*/Tests/Unit'),
#realtime uses log-json which emits tons of Notices about "Array to string conversion" when testing TYPO3.Eel/Context
:realtime => true,
TYPO3:
Flow:
object:
excludeClasses:
'videlalvaro.php-amqplib': ['.*']
persistence:

Keybase proof

I hereby claim:

  • I am cognifloyd on github.
  • I am cognifloyd (https://keybase.io/cognifloyd) on keybase.
  • I have a public key whose fingerprint is E559 11A2 9B43 F870 D8A4 85AF 1A72 D048 C9AA 75BE

To claim this, I am signing this object:

# skipping everything above the next line
php composer.phar require --no-progress --no-interaction 'typo3/doctools:dev-master'
FLOW_CONTEXT=Production ./flow typo3.flow:cache:flush
FLOW_CONTEXT=Production ./flow typo3.flow:cache:warmup
FLOW_CONTEXT=Production ./flow typo3.doctools:commandreference:rendercollection Flow
FLOW_CONTEXT=Production ./flow typo3.doctools:reference:rendercollection Flow
# run this in Development - Production doesn't have the needed reflection data
@cognifloyd
cognifloyd / test_actions_lib_ansiblebaserunner.py
Created June 21, 2017 23:34
testing the actions/lib/ansible_base.py:AnsibleBaseRunner._parse_extra_vars()
from __future__ import print_function
import unittest
import yaml
from mock import patch
from lib.ansible_base import AnsibleBaseRunner