Skip to content

Instantly share code, notes, and snippets.

Generate a concise commit message based on the changes.

## Rules
* One short summary line (max 50 characters recommended)
* Group related changes logically - avoid listing every single file
* Use bullet points only if there are multiple distinct change groups
* Start bullets with action verbs: Add, Remove, Update, Fix, Refactor, Improve
* Capitalize first word of each bullet
* No punctuation at end of lines
@alaugks
alaugks / allowed_roles_for_route.md
Created March 2, 2024 01:29 — forked from leotiger/allowed_roles_for_route.md
Symfony3: Check if a route is accessible for a ROLE or a list of ROLES

I've implemented this in a current project as a service. The solution is straightforward but depends on security annotations. You may adapt the solution to fit your needs... It should be easy to use custom annotations or to combine this with configuration options running in from config.yml or a database.

This is related with Symfony Issue #6538

namespace Acme\Security\Roles;

use Symfony\Component\HttpFoundation\Request;
@alaugks
alaugks / php_hashing_checksum_performance.php
Created February 29, 2024 21:53 — forked from shlomohass/php_hashing_checksum_performance.php
This test will compare checksum methods with php hashing procedures and some basic ones too -> crc32(), md5(), sha1(), xor(), xor2(), add(). The text is randomly generated each iteration to avoid caching, the test also use several text length that will be different each iteration.
<?php
/*******************************************************************************
* Created by: shlomo hassid.
* Release Version : 1.1
* Creation Date: 02/04/2018
*
* This test will compare checksum methods with php hashing procedures and some
* basic ones to -> crc32(), md5(), sha1(), xor(), xor2(), add().
* The text is randomly generated each iteration to avoid caching, the test also
* use several text length that will be defferent each iteration.
@alaugks
alaugks / github-action-docker-hub-push-image.yml
Last active April 29, 2024 15:24
Build docker image an push to docker registry.
name: Docker Hub Push Image
run-name: Docker Hub Push Image [${{ github.ref_name }}]
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker Login
@alaugks
alaugks / ansible-makefile
Last active July 27, 2023 12:21
Ansible Makefile (Run ansible-playbook with params)
# make deploy-production version=foobar
# make deploy-stage version=foobar
deploy-production:
ansible-playbook -vv -i ansible/hosts -e 'release=${shell date +"%Y%m%d%H%M%S"} version=$(version)' ansible/deploy-production.yml
deploy-stage:
ansible-playbook -vv -i ansible/hosts -e 'release=${shell date +"%Y%m%d%H%M%S"} version=$(version)' ansible/deploy-stage.yml
@alaugks
alaugks / curl_github_actions_workflow.txt
Created July 25, 2023 01:19 — forked from iamcryptoki/curl_github_actions_workflow.txt
Run GitHub Actions Workflow using Curl (workflow_dispatch).
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <ACCESS_TOKEN_HERE>" \
https://api.github.com/repos/<ORG_OR_USERNAME>/<REPO>/actions/workflows/<FILENAME_OR_WORKFLOW_ID>/dispatches \
-d '{"ref":"refs/heads/master"}'