Skip to content

Instantly share code, notes, and snippets.

View wlalele's full-sized avatar

Amine Daï wlalele

View GitHub Profile
@wlalele
wlalele / request.bash
Created January 27, 2021 13:46
example generation balisage
curl --location --request POST 'http://localhost:8001/api/printable.pdf' \
--header 'Content-Type: application/json' \
--header 'Cookie: XDEBUG_SESSION=PHPSTORM' \
--data-raw '{
"products": [
{
"sku": "L40676700-8",
"brand": "Brooks",
"brandLogo": "https://cdn.leoburnett.media/image/2/885/0/5/uploads/brooks1920.png",
"image": "https://www.wigglestatic.com/product-media/102729584/L40790800_0_Jr_speedcross_cs_wp_j_lyons_blue.jpg.originale.jpg?w=100&h=100&a=7",
@wlalele
wlalele / sport-categories.json
Last active October 20, 2020 15:32
example of response
{
"data": [
{ "id": 1, "label": "dances", "sports": [120, 121] },
{ "id": 2, "label": "courses", "sports": [155, 156] },
{ "id": 3, "label": "fitness", "sports": [155, 156, 120, 121] }
]
}
@wlalele
wlalele / script-painless.java
Last active November 18, 2020 13:38
working use-case activities
// find timeslot by sku in a collection
def findById(def timeslots, def timeslotId) {
for (def timeslot: timeslots) {
if (timeslot.timeslotId == timeslotId) {
return timeslot;
}
}
return null;
}
@wlalele
wlalele / en.json
Last active March 25, 2020 09:30
en.json
{
"checkout": {
"summary": {
"information": "Subscription details",
"payment-method": "Payment method",
"payment-methods": {
"online": "Online payment"
},
"cart": {
"title": "Attendee(s) and price",
@wlalele
wlalele / fr.json
Last active March 25, 2020 09:30
fr.json
{
"checkout": {
"summary": {
"information": "Détail d'inscription",
"payment-method": "Mode de paiement",
"payment-methods": {
"online": "Paiement en ligne"
},
"cart": {
"title": "Participant(s) et prix",
@wlalele
wlalele / pre-push
Created June 12, 2018 09:06
Git hook pre-push - Resamania2 Groot
#!/bin/sh
exec < /dev/tty
make requirements-status
make code-analysis
make coding-standard
make deprecation-detection
docker-compose exec php make unit-test
docker-compose exec php make behavior-test
@wlalele
wlalele / prepush
Created February 5, 2018 16:21
Custom PrePush hook
#!/bin/sh
exec < /dev/tty
while true; do
read -p "Is the documentation, coding-standard and tests okay? (Y/n) " yn
if [ "$yn" = "" ]; then
yn='Y'
fi
case $yn in
@wlalele
wlalele / _update_project
Last active September 20, 2017 09:40
function bash to update a symfony 1.4 project
function _update_project {
if [ -z "$1" ] || [ -z "$2" ]; then
echo 'You have to call this method with 2 parameters, the git tag/branch name and the environment (prod, dev, ...)'
return
fi
git fetch -a
git checkout $1
git pull
composer install
@wlalele
wlalele / composer_without_xdebug_alias.sh
Last active November 23, 2016 14:02
Composer without xdebug
alias comp="php -n $(which composer)"
@wlalele
wlalele / sf
Created November 21, 2016 09:39
Symfony CLI shortcut for all versions
#!/bin/bash
ARGS=$*
function checkSf {
if [ -f $1 ];
then
php $1 $ARGS
fi
}