Skip to content

Instantly share code, notes, and snippets.

View cedricziel's full-sized avatar
🥸

Cedric Ziel cedricziel

🥸
View GitHub Profile
if($projects = $service->getProjects()){
//if($projects = $this->projectRepository->getAllProjectsByService($service)){
foreach($projects as $project){
foreach($project->getSlides() as $slide)
$slidearray[] = $this->formatSlide($slide);
}
}
@cedricziel
cedricziel / handler.js
Created February 19, 2014 16:14
File upload with node-imager and hapijs
AccountController.prototype.setProfilePicAction = function setProfilePic(request, reply) {
// remember to load your config in imagerConfig
var imagerConfig = {json: 'config'};
var file = {
name : request.payload.file.filename,
path: request.payload.file.path,
type: request.payload.file.headers['content-type'],
size: request.payload.file.bytes
};
<IfModule pagespeed_module>
# Variables
#ModPagespeedAnalyticsID UA-6872579-4
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
ModPagespeed On
# ModPageSpeed On
ModPagespeedMapOriginDomain "http://p0023.ihre-preview.de" "https://p0023.ihre-preview.de"
# ModPagespeedRewriteLevel CoreFilters
{namespace v=Tx_Vhs_ViewHelpers}
{namespace flux=FluidTYPO3\Flux\ViewHelpers}
<f:layout name="Content" />
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="http://fedext.net/ns/vhs/ViewHelpers"
xmlns:flux="http://fedext.net/ns/flux/ViewHelpers"
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
<f:section name="Configuration">
{v:var.typoscript(path: 'plugin.tx_fluidcontentbootstrap.settings') -> v:var.set(name: 'settings')}
@cedricziel
cedricziel / jenkins-run.sh
Created May 26, 2014 10:47
DJB Daemon Tools Script for Jenkins CI. Jenkins runs in foreground by default. So either screen or DaemonTools (which is generally a good choice for non-distribution-supplied daemons) would do a good job. Following this guide, you'd keep the firewall clean, and proxy via Apache or Nginx to localhost:61000.
#!/bin/bash
# These environment variables are sometimes needed by the running daemons
export USER=jenkins
export HOME=/home/jenkins
# Include the user-specific profile, it's actually called .profile on debian.
. $HOME/.profile
# Now let's go!
@cedricziel
cedricziel / Question.md
Last active August 29, 2015 14:02
Question: Streamlining the loading of language files with lazy loading on a controller basis whilst keeping the controller clean.

Status Quo:

I'm registering/configuring the base params of angular-translate like:

ngModule.config(
[
    '$translateProvider', '$translatePartialLoaderProvider',
    function ($translateProvider, $translatePartialLoaderProvider) {

        $translateProvider.useLoader('$translatePartialLoader', {
@cedricziel
cedricziel / gitlab-run.sh
Last active August 29, 2015 14:03
GitLab Uberspace Daemon Tools config
#!/bin/bash
# These environment variables are sometimes needed by the running daemons
export USER=user
export HOME=/home/user
# Include the user-specific profile, it's actually called .profile on debian.
. $HOME/.profile
export PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
<?php
namespace Smichaelsen\Gist\Mail;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext;
/**
* This class represents an email which can be rendered with fluid.
* You can use all the possibilities of TYPO3's MailMessage but instead of
<?php
$query = $this->publicationRepository->createQuery();
$executor = new FilterChainExecutor($query);
$filters = new FilterChain();
$filters
->addSimpleFilter(
new NoHiddenFilter()
)
->addSimpleFilter(
<?php
namespace ACME\Institute\Tests\Domain\Repository;
/***************************************************************
*
* Copyright notice
*
* (c) 2015 Cedric Ziel <cedric@cedric-ziel.com>
*