Skip to content

Instantly share code, notes, and snippets.

View fnagel's full-sized avatar

Felix Nagel fnagel

View GitHub Profile
@amit
amit / Quic bookmarklet.js
Created March 22, 2011 23:47
Expanded Quix bookmarklet
javascript:Quix();function Quix() {
var e=encodeURIComponent; // shortcut for the function name
var t=window.getSelection ? window.getSelection():
(document.getSelection? document.getSelection(): (document.selection ? document.selection.createRange().text:'')); // Get selection or empty string
var c=window.prompt('Quix: Type `help` for a list of commands:');
if(t!='') {
if(c) {
c+=' '+t; // append selection to typed text
}
else {
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@helhum
helhum / PersistentObjectConverter.php
Last active January 24, 2021 14:08
Extbase TypeConverter to fetch hidden records from persistence (Using this will *always* fetch hidden models of the specified type)
<?php
namespace MyVendor\MyExtension\Property\TypeConverters
use TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter
class MyPersistentObjectConverter extends PersistentObjectConverter {
/**
* @var string
*/
@cedricziel
cedricziel / README.md
Last active October 27, 2021 08:12
TYPO3 Extension with 3rd part composer dependencies. composer.json is placed in Resources/Private - Updated

Motivation

As long as composer support in CMS is "not there yet", you need to get around somehow.

Say you want to use the (awesome) markdown library, you need a way to get it in.

How

  1. Use a container extension with a private namespace
@dmitryd
dmitryd / Typo3DbQueryParser.php
Last active September 7, 2017 07:35
Fix issue with incorrect localization handling in Extbase (missing support for l10n_mode=exclude, which makes some relations missing). See http://bit.ly/1Djw1CV
<?php
namespace DmitryDulepov\Sample\Xclass;
class Typo3DbQueryParser extends \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser {
/**
* Fixes incorrect localisation handling in Extbase.
*
* @param string $tableName
* @param array $sql
@wouterds
wouterds / convert-mapstylejson-to-urlargs.php
Created January 27, 2015 14:42
Convert google maps style json to url arguments to use for google maps static images.
<?php
public function mapStylesUrlArgs($mapStyleJson)
{
$params = [];
foreach (json_decode($mapStyleJson, true) as $style) {
$styleString = '';
if (isset($style['stylers']) && count($style['stylers']) > 0) {
@smichaelsen
smichaelsen / QueryResult.php
Created November 12, 2015 08:19
Extend extbase QueryResult to fix count() of queries with a custom $statement
<?php
namespace AppZap\Tripshop\Persistence;
use TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement;
class QueryResult extends \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult
{
/**
* Overwrites the original implementation of Extbase
*
@peterkraume
peterkraume / Page.ts
Created July 20, 2017 09:51
Backport for TYPO3 8.7: PageLayoutView - Allow to disable copy- / translate- buttons
mod {
web_layout {
// disable translation mode for content elements
// backported feature from TYPO3 9.x. See Xclass PageLayoutView.php for details
localization.enableTranslate = 0
}
}