Skip to content

Instantly share code, notes, and snippets.

View sbruggmann's full-sized avatar

Stefan Bruggmann sbruggmann

View GitHub Profile
@sbruggmann
sbruggmann / move-nodetree.sql
Last active November 23, 2018 08:44
Move large Neos NodeTree to new Parent with MySQL
START TRANSACTION;
SET NAMES utf8 COLLATE utf8_unicode_ci;
alter database YOUR_DATABASE default character set utf8;
alter database YOUR_DATABASE default collate utf8_unicode_ci;
SET @whereLikePath = '%node-57fe3793425c0%';
SET @oldPath = '/sites/theme/node-57fe3793425c0';
SET @newPath = '/sites/theme/node-nm3vs6pu3hzod/node-57fe3793425c0';
SET @oldParentpath = '/sites/theme';
SET @newParentpath = '/sites/theme/node-nm3vs6pu3hzod';
@sbruggmann
sbruggmann / WrapSvg.fusion
Created May 30, 2018 15:23
Neos Fusion wrap SVG to make it responsive in IE's
prototype(Vendor.Package:WrapSvg) < prototype(Fusion:Tag) {
sizes = ${String.pregMatch(value, '/viewBox="(\d+) (\d+) (\d+) (\d+)"/i')}
width = ${this.sizes[3] - this.sizes[1]}
height = ${this.sizes[4] - this.sizes[2]}
ratio = ${this.height / this.width * 100}
@context.ratio = ${this.ratio}
tagName = 'div'
attributes {
class = 'svg-wrap'

Keybase proof

I hereby claim:

  • I am sbruggmann on github.
  • I am sbruggmann (https://keybase.io/sbruggmann) on keybase.
  • I have a public key ASDvZgElLnPTF7Au6zberEncb-qrKN9mCD-YGsNeU5Kyygo

To claim this, I am signing this object:

@sbruggmann
sbruggmann / helper.sh
Created March 11, 2017 14:25
Transfer mercurial repository to git including productive tags
#!/bin/bash
if [ -z "$1" ]; then
echo "please add a target repository"
exit
fi;
rm -rf .git
hg checkout tip --clean
@sbruggmann
sbruggmann / Settings.yaml
Created October 9, 2016 14:55
Hostpoint PHP CLI memory_limit Workaround - Neos CMS
TYPO3:
Flow:
core:
phpBinaryPathAndFilename: '/home/username/php70ml512'
@sbruggmann
sbruggmann / .bash_ssh
Last active October 16, 2016 08:30
bash ssh shortcut
# add "source ~/.bash_ssh" to your .bash_profile
# execute ssh-add-shortcut
ssh-add-shortcut() {
if [ -z "$1" ]; then
echo ""
echo "add and open:"
echo "# ssh-add-shortcut MyShortname user@server.com"
echo ""
echo "open:"
@sbruggmann
sbruggmann / .editorconfig
Last active March 22, 2016 12:12
Neos CMS & Flow Framework Code Styles
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# 4 tab; default
# html, css, scss, js, ..
[*]
@sbruggmann
sbruggmann / .bash_profile
Last active December 17, 2020 21:32
ADB - Backup and restore Android folders recursive with OS X
# add to your .bash_profile, copy android-backup-files.sh & android-restore-files.sh to /Users/YOUR_USERNAME/ and reload the terminal to use the shortcuts..
# important, not all apps and data can backed up
alias android-backup-apps='echo "enter sudo password:"; /Applications/Android\ Studio.app/sdk/platform-tools/adb backup -apk -shared -all -f "/Users/YOUR_USERNAME/Documents/privat/backups/android-backup-full-$(date +%Y%m%d).ab"'
# to restore call (change the date):
# /Applications/Android\ Studio.app/sdk/platform-tools/adb restore /Users/YOUR_USERNAME/Documents/privat/backups/android-backup-full-YYY-MM-DD.ab
# important, add the paths to backup in both files
alias android-backup-files='echo "enter sudo password:"; ~/android-backup-files.sh;'
alias android-restore-files='echo "enter sudo password:"; ~/android-restore-files.sh;'
@sbruggmann
sbruggmann / PersonsController.php
Created February 10, 2015 09:08
Access Nodes in a TYPO3 Neos Package Controller
<?php
namespace My\Package\Controller;
class PersonsController extends ActionController {
/**
* @return void
*/
public function personsAction() {
@sbruggmann
sbruggmann / StandardController.php
Created December 24, 2014 12:41
Get current Language in TYPO3 Neos Controller
<?php
namespace My\Custom\Controller;
use TYPO3\Flow\Annotations as Flow;
class StandardController extends \TYPO3\Flow\Mvc\Controller\ActionController {
/**
* @Flow\Inject
* @var \TYPO3\Flow\I18n\Service