Skip to content

Instantly share code, notes, and snippets.

View revsbech's full-sized avatar

Jan-Erik Revsbech revsbech

View GitHub Profile
@revsbech
revsbech / Gruntfile.js
Created May 27, 2014 07:13
Default Gruntfile
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
src: [
'../../Resources/Public/JavaScript/Vendor/*.js',
@revsbech
revsbech / MyPluginController.php
Created June 30, 2014 08:01
Various Neos plugin snippets
/*
Accessing the current node or page (documentNde)
*/
/** @var \TYPO3\TYPO3CR\Domain\Model\Node $currentNode */
$currentNode = $request->getInternalArgument('__node');
/** @var \TYPO3\TYPO3CR\Domain\Model\Node $currentNode */
$currentPage = $request->getInternalArgument('__documentNode');
/*
@revsbech
revsbech / PdfController.php
Created July 9, 2014 07:39
Example PDF Generation as plugin
<?php
namespace Aris\DailyReports\Controller;
/* *
* This script belongs to the TYPO3 Flow package "Aris.DailyReports". *
* *
* */
use Aris\DailyReports\Utility\WkHtmlToPdfUtility;
use TYPO3\Flow\Annotations as Flow;
<?php
class Tx_MocBeer_Domain_Model_Consumer {
/**
* @var Tx_MocBeer_Domain_Service_InventoryService
* @inject
*/
protected $inventoryService;
container_commands:
10-flush-cache:
command: "php flow flow:cache:flush --force"
env:
FLOW_CONTEXT: Production
20-warump-cache:
command: "php flow flow:cache:warmup"
env:
FLOW_CONTEXT: Production
www-data@dev02:~/fkdk-latest/flow/Packages/Sites/FIT.FolkekirkenDk/Build(master⚡) » grunt watch
Running "watch" task
Waiting...
>> File "../Resources/Private/Styles/_PsalmDatabase.scss" changed.
Running "compass:dist" (compass) task
DEPRECATION WARNING:
Sass 3.5 will no longer support Ruby 1.9.3.
Please upgrade to Ruby 2.0.0 or greater as soon as possible.
@revsbech
revsbech / Makefile
Last active May 9, 2016 14:37
Example of writing Neos configuration from from PCO settings json file
#
#
# The build, release and restart targets are defined in the app, and are run at different stages of the build.
# The build and release are done on the build-server (pubhub), whereas the restart are run on each webnode
#
# Notice that the pco.json conf file is not present during the build phase, but it present during release
#
build: composer rmResourcesDir
application:
image: tianon/true
volumes:
- .:/var/www/myapp
mysql:
image: mariadb:10.1
ports:
- "3308:3306"
environment:
MYSQL_ROOT_PASSWORD:123
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: symfony
annotations:
pod.alpha.kubernetes.io/init-containers: '[{
"name": "install",
"image": "revsbech/symfonydemo",
"command": ["cp", "-a", "/var/www/application", "/app"],
"volumeMounts": [
<?php
if ($argc != 2) {
print "Usage:: primes.php <max>" . PHP_EOL;
exit (1);
}
$i = 1;