Skip to content

Instantly share code, notes, and snippets.

View Konafets's full-sized avatar

Stefano Kowalke Konafets

View GitHub Profile
@tomasnorre
tomasnorre / README.md
Last active September 26, 2019 15:10

What does it do?

This littel script fetches all packages, listed on packagist with type typo3-cms-extension, and iterates over them and collect download data for every single packages.

It will echo it as csv, so it can easily be parsed into a .csv file for better sorting etc.

How to generate csv file

$ php fetchExtensionDownloadDataFromPackagist.php > downloadData.csv
<?php
namespace VENDOR\EXTENSION\ViewHelpers;
class DebugbarViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
{
/**
* Displays the debug informationen in the PHP Debug Bar
*
* @param null $content
@ProcessEight
ProcessEight / Debug API requests.md
Last active January 18, 2021 13:20
Example scripts showing how to debug API calls with Xdebug

Debugging with Xdebug

Debug from the command line in Xdebug

Just export the XDEBUG_CONFIG variable:

export XDEBUG_CONFIG="idekey=PHPSTORM"

Remember to enable Xdebug first:

@alfhh
alfhh / ga-video.js
Created July 10, 2017 20:17 — forked from kyleridolfo/ga-video.js
HTML5 Video Tracking for Google Tag Manager
<script>
// Let's wrap everything inside a function so variables are not defined as globals
(function(){
// This is gonna our percent buckets ( 10%-90% )
var divisor = 10;
// We're going to save our players status on this object.
var videos_status = {};
// This is the funcion that is gonna handle the event sent by the player listeners
function eventHandler(e){
switch(e.type) {
@einpraegsam
einpraegsam / InsertExample.php
Last active February 21, 2024 13:23
TYPO3 QueryBuilder example use
<?php
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
// insert into tt_content (header, crdate, pid) VALUES ("New content", 123456789, 123);
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
$queryBuilder
->insert('tt_content')
->values([
'header' => 'New content',
@tessi
tessi / my-way-to-postgresql-9-6-2-on-an-uberspace.md
Last active November 27, 2018 22:53
Upgrade Postgresql from 9.2 to 9.6 on an uberspace

Upgrade Postgresql from 9.2 to 9.6 on an uberspace

Uberspace (an awesome german web hoster) has superb postgresql support, except that it currently only offers postgresql versions 9.2.x and 9.3.x. I run postgresql 9.6.2 on my uberspace and documented steps for a migration to postgresql 9.6 here.

My goal was to be as close to the original uberspace-postgresql-setup as possible, but I had to copy and modify some uberspace scripts so they correctly use the new postgresql version.

Warning: Here be dragons. This is what I did -- that doesn't mean you should do the same or what I did was clever. Always backup your data and maybe test on a throw-away uberspace first. If you find things to improve, let me know and I'll try to keep this updated.

What I assume you have

0: Ohne BahnCard,
1: BahnCard 25, 1. Klasse,
2: BahnCard 25, 2. Klasse,
3: BahnCard 50, 1. Klasse,
4: BahnCard 50, 2. Klasse,
9: A - VORTEILScard (incl. RAILPLUS),
10: CH - HalbtaxAbo (incl. RAILPLUS),
11: CH - HalbtaxAbo (ohne RAILPLUS),
12: NL - Voordeelurenabo (incl. RAILPLUS),
13: NL - Voordeelurenabo (ohne RAILPLUS),
@azimidev
azimidev / _Laravel_Queue_Supervisor_Instruction.md
Last active November 15, 2022 14:42 — forked from danharper/a.md
Laravel Queue Supervisor

Install Supervisor with sudo apt-get install supervisor in Unix or brew install supervisor in Mac OSX. Ensure it's started with sudo service supervisor restart in Unix or brew services start supervisor in Mac OSX.

In Unix in /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

In Mac OSX first run supervisord -c /usr/local/etc/supervisord.ini and in /usr/local/etc/supervisor.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread in Unix and with: brew services restart supervisor in MAc OSX . And start using those changes with: sudo supervisorctl update.

@smichaelsen
smichaelsen / DateInterval.php
Last active November 26, 2015 09:19
Example how to use the TypeInterface to let extbase initialize objects from your database records
<?php
namespace AppZap\MyExt\Type;
use TYPO3\CMS\Core\Type\TypeInterface;
/**
* In our application we have fields that store time intervals as minutes in the database.
* In our code we want proper DateInterval objects, so we use a TypeInterface to let extbase take care of the conversion.
*
* Usage example on a model property:
@jwalton512
jwalton512 / gulpfile.js
Created June 4, 2015 14:25
elixir+less+scripts+browserify+version
elixir(function (mix) {
mix.less('app.less')
.less('admin.less')
.scripts(['libs/**/*.js', 'app/**/**/*.js'], 'resources/assets/build/app.js')
.browserify('app.js', 'public/js/app.js', 'resources/assets/build')
.version('js/app.js')
});