Skip to content

Instantly share code, notes, and snippets.

View cyrildewit's full-sized avatar
💻

Cyril de Wit cyrildewit

💻
View GitHub Profile
@Miguel-Serejo
Miguel-Serejo / benchmark.php
Created December 27, 2019 17:23
Benchmarking different startsWith strategies
<?php
$providers = [
'Illuminate\Auth\AuthServiceProvider',
'Illuminate\Broadcasting\BroadcastServiceProvider',
'Illuminate\Bus\BusServiceProvider',
'Illuminate\Cache\CacheServiceProvider',
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
'Illuminate\Cookie\CookieServiceProvider',
'Illuminate\Database\DatabaseServiceProvider',
'Illuminate\Encryption\EncryptionServiceProvider',
@djaiss
djaiss / Laravel 6.x Github Action with SQLite
Created November 25, 2019 13:29
Working example on how to use SQLite with a Laravel 6.x installation.
name: Unit tests
on: [push]
jobs:
phpunit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Copy .env
@agoldis
agoldis / delete-github-package.graphql
Created October 25, 2019 05:26
Github - delete private package
# get version id
query($name: String!, $owner: String!) {
repository(name: $name, owner: $owner) {
id
name
registryPackages(first: 10) {
nodes {
versions(first: 10) {
nodes{
id
@marcnewton
marcnewton / _SetLocaleAcceptLanguage.php.md
Last active January 12, 2021 11:10
Laravel Middleware Accept-Language to setLocale
@migueldoctor
migueldoctor / Dockerfile
Last active October 14, 2022 02:57
Dockerfile including open jdk8 + maven 3.6.1 + gradle 4.0.1
FROM openjdk:8-jdk-alpine
LABEL Miguel Doctor <[email protected]>
RUN apk add --no-cache curl tar bash procps
# Downloading and installing Maven
ARG MAVEN_VERSION=3.6.1
ARG USER_HOME_DIR="/root"
ARG SHA=b4880fb7a3d81edd190a029440cdf17f308621af68475a4fe976296e71ff4a4b546dd6d8a58aaafba334d309cc11e638c52808a4b0e818fc0fd544226d952544
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active May 20, 2025 03:39
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@ramantehlan
ramantehlan / README-Fancy.md
Last active March 2, 2025 00:00
README template I use for most of my projects.

Introduction

  • Add your project logo.
  • Write a short introduction to the project.
  • If you are using badges, add them here.

📒 Index

interface ConfirmDialogConfig {
title: string;
text: string;
deleteButtonText: string;
}
/**
* A hook that will allow you to prompt a user for confirmation before doing a delete, by showing a "Are you sure" modal.
* @param action - the action to be performed when the user presses delete
@sirthxalot
sirthxalot / Countries.php
Last active May 2, 2025 06:33
Country List for Laravel's Enum
<?php namespace App\Enums;
use BenSampo\Enum\Enum;
use BenSampo\Enum\Contracts\LocalizedEnum;
final class Countries extends Enum
{
const AF = "Afghanistan";
const AL = "Albania";
const DZ = "Algeria";
@nonsocode
nonsocode / n-errorbag.js
Created August 9, 2018 13:19
A simple Frontend Validation Error bag meant to work with Laravel validation
class ErrorBag {
constructor(errors = {}) {
this.setErrors(errors);
}
hasErrors() {
return !!this.keys.length;
}
get keys() {