Skip to content

Instantly share code, notes, and snippets.

View machwatt's full-sized avatar
💭
I may be slow to respond.

Jöran Kurschatke machwatt

💭
I may be slow to respond.
View GitHub Profile
@paulirish
paulirish / what-forces-layout.md
Last active July 2, 2024 13:24
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@seriousManual
seriousManual / packstations.php
Last active February 1, 2021 15:14
Minimal code example for a SOAP call to the DHL API (Packstations search)
<?php
$userName = 'fooUser';
$password = 'fooPassword';
$endpoint = 'https://cig.dhl.de/services/sandbox/soap';
$client = new SoapClient("https://cig.dhl.de/cig-wsdls/com/dpdhl/wsdl/standortsuche-api/1.0/standortsuche-api-1.0.wsdl", [
'login' => $userName,
'password' => $password,
'location' => $endpoint,
@htuscher
htuscher / NodeHelper.php
Last active December 19, 2015 04:34
Neos Sliding ContentCollection
<?php
/***************************************************************
* Copyright notice
*
* (c) 2015 Hans Höchtl <hhoechtl@1drop.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
<?php
use TYPO3\Surf\Domain\Model\Node;
use TYPO3\Surf\Domain\Model\SimpleWorkflow;
$application = new \TYPO3\Surf\Application\TYPO3\Flow();
$application->setOption('repositoryUrl', 'git@github.com:acme/acme.git');
$application->setOption('localPackagePath', FLOW_PATH_DATA . 'Checkout' . DIRECTORY_SEPARATOR . $deployment->getName() . DIRECTORY_SEPARATOR . 'Live' . DIRECTORY_SEPARATOR);
$application->setOption('composerCommandPath', 'composer');
$application->setOption('transferMethod', 'rsync');
$application->setOption('rsyncFlags', '--recursive --times --perms --links --delete');
$application->setOption('packageMethod', 'git');
@aertmann
aertmann / .gitignore
Last active October 28, 2015 05:14
Neos site versioning with one repository – Included in https://speakerdeck.com/aertmann/tasty-recipes-for-every-day-neos
/Build/**
!/Build/Surf**
/Configuration/**
!/Configuration/**.yaml
/Data/
/Web/
/bin/
/Readme.txt
/Upgrading.txt
/flow
@mhuber84
mhuber84 / AdditionalConfiguration.php
Last active August 29, 2015 14:03
TYPO3 Surf deployment for TYPO3 CMS with 4 target nodes
<?php
$GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword'] = '$P$CEF2NP3kCoIHwDupr8RiYUMQ7/Rp.j.';
$GLOBALS['TYPO3_CONF_VARS']['DB']['database'] = 'projects_my_multiplenodes';
$GLOBALS['TYPO3_CONF_VARS']['DB']['username'] = 'user';
$GLOBALS['TYPO3_CONF_VARS']['DB']['password'] = 'secret';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] = 'My MultipleNodes';
@aertmann
aertmann / ContentCollectionImplementation.php
Last active January 13, 2021 13:42
Slide support in content collection
<?php
namespace TYPO3\NeosDemoTypo3Org\TypoScript;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\TYPO3CR\Domain\Model\NodeInterface;
/**
* Extended TypoScript implementation to render ContentCollections. Will render needed
* metadata for removed nodes and has support for slide.
*/
@beelbrecht
beelbrecht / NeosDeployment.php
Last active May 8, 2020 08:14
Example Script to deploy TYPO3 Neos with TYPO3 Surf on uberspace shared hosting
<?php
// TYPO3 Surf script to deploy and update TYPO3 Neos at your uberspace.de account
// before of after the initial deployment, you have to setup some things manually at your host (e.g. DB credentials in Settings.yaml)
// Note: replace placeholders such as [PLACEHOLDER] with the correct information
// Create a simple workflow based on the predefined 'SimpleWorkflow'.
$workflow = new \TYPO3\Surf\Domain\Model\SimpleWorkflow();
@InvisibleKind
InvisibleKind / MyController.php
Last active May 14, 2019 14:00
FAL handling in FlexForms
public function indexAction() {
/** @var \TYPO3\CMS\Core\Resource\ResourceFactory $resourceFactory */
$resourceFactory = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
$fileReference = $resourceFactory->getFileReferenceObject($this->settings['test']);
$fileArray = $fileReference->getProperties();
$this->view->assign('image', $fileArray);
}
@dariocravero
dariocravero / README.md
Created October 20, 2012 05:25
Save files in Meteor

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.