Skip to content

Instantly share code, notes, and snippets.

View juuuuuu's full-sized avatar
🏡
Working from home

Julien Manganne juuuuuu

🏡
Working from home
View GitHub Profile
@florentdestremau
florentdestremau / NewPasswordType.php
Last active August 1, 2024 15:14
A simple User authentication setup to copy & paste into your Symfony 3.4 install
<?php
namespace AppBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
@mindplay-dk
mindplay-dk / session-life-cycle.md
Last active August 26, 2024 23:46
Complete overview of the PHP SessionHandler life-cycle

This page provides a full overview of PHP's SessionHandler life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and what you can expect will be called in your custom SessionHandler implementation.

Each example is a separate script being run by a client with cookies enabled.

To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().

@mRoca
mRoca / git_flow.md
Last active November 6, 2020 17:10
Git flow

Naming convention

Item Name
Release branch release/v2.0.1
Feature branch feature/my_feature_name
Feature branch feature/2234_my_feature_name
Hotfix branch hotfix/my_hotfix_name
Commit Add my news
Tag v2.0.1
@lyrixx
lyrixx / segfault-finder.php
Last active August 15, 2023 21:17
How to find a segfault in PHP
<?php
register_tick_function(function() {
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
$last = reset($bt);
$info = sprintf("%s +%d\n", $last['file'], $last['line']);
file_put_contents('/tmp/segfault.txt', $info, FILE_APPEND);
// or
// file_put_contents('php://output', $info, FILE_APPEND);
});