Skip to content

Instantly share code, notes, and snippets.

View pitchart's full-sized avatar

Julien VITTE pitchart

View GitHub Profile
@pitchart
pitchart / commands.txt
Last active May 3, 2022 08:30
Dawin 2022
# run containers
docker-compose up -d mysql [apache|nginx]
# exec bash (php commands)
docker-compose exec --user=www-data php-fpm bash
# consoles
php vendor/bin/typo3cms
# or
php vendor/bin/typo3
@pitchart
pitchart / extract-index.js
Created January 16, 2020 08:33
Mongodb extract index creation script
db.getCollectionInfos({ type: "collection" }).forEach(function(coll) {
db[coll.name].getIndexes().forEach(function(index) {
if ("_id_" !== index.name) {
print("db." + coll.name + ".createIndex(" + tojson(index.key) + ", "+tojson({name:index.name})+");");
}
});
});
@pitchart
pitchart / flexform.xml
Last active January 30, 2018 15:52
Champ de sélection d'une page dans un plugin TYPO3
<settings.authorsPage>
<TCEforms>
<label>Page auteurs</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>pages</allowed>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
@pitchart
pitchart / Makefile
Created March 14, 2017 17:07
makefile for symfony projects
CONSOLE=php app/console
COMPOSER=php -d "apc.enable_cli=0" ../composer.phar
PHPUNIT=php bin/phpunit
init: git-clone install
install: git-subup composer-install cache-clear assets db cache-clear
update: git-update git-subup composer-install db-update cache-clear composer-optimize test-unit
@pitchart
pitchart / gitlab-webhook-push.php
Created December 30, 2016 15:32
A simple php script to manage gitlab push webhook
<?php
/**
* GitLab Web Hook
* See https://gitlab.com/kpobococ/gitlab-webhook
*
* This script should be placed within the web root of your desired deploy
* location. The GitLab repository should then be configured to call it for the
* "Push events" trigger via the Web Hooks settings page.
*
* Each time this script is called, it executes a hook shell script and logs all
@pitchart
pitchart / .htaccess
Created December 27, 2016 09:48
htaccess configuration for webfonts
# ----------------------------------------------------------------------
# Webfonts
# ----------------------------------------------------------------------
# allow access from all domains for webfonts
<FilesMatch "\.(ttf|otf|eot|woff|font.css)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
@pitchart
pitchart / Makefile
Created November 25, 2016 15:39
Auomatic commit on symfony version bump with shivas/versioning-bundle
version-patch:
$(eval version := $(shell php app/console app:version:bump --patch=1))
$(SUDO) git add app/config/version.yml
$(SUDO) git commit -m "[RELEASE] version $(version)"
version-feature:
$(eval version := $(shell php app/console app:version:bump --minor=1))
$(SUDO) git add app/config/version.yml
$(SUDO) git commit -m "[RELEASE] version $(version)"
@pitchart
pitchart / submodule_registerer.sh
Created September 30, 2016 12:10
Register git submodule from a .gitmodule file
#!/bin/sh
set -e
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
url=$(git config -f .gitmodules --get "$url_key")
git submodule add $url $path