Skip to content

Instantly share code, notes, and snippets.

View cyrildewit's full-sized avatar
💭
I may be slow to respond.

Cyril de Wit cyrildewit

💭
I may be slow to respond.
View GitHub Profile
export default function(originalPromise, delay = 750) {
return Promise.all([
originalPromise,
new Promise(resolve => {
setTimeout(() => resolve(), delay)
}),
]).then(result => result[0])
}
// Usage
@Potherca
Potherca / README.md
Last active June 17, 2020 09:51
List of kick-ass developers to follow based in the Netherlands
@ericlbarnes
ericlbarnes / PewPewPew.php
Created May 7, 2020 15:12
Hold up... Wait a minute... It's a Laravel Chopper
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class PewPewPew extends Command
{
protected $signature = 'pewpewpew';
protected $description = 'Command description';
@bubba-h57
bubba-h57 / phpunit.yml
Created April 29, 2020 19:37
Github Actions Continuous Integration/Testing workflow for PHP 7.4, Laravel 7, MariaDb, & Redis.
name: Laravel 7, MariaDb, & Redis CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
continuous-integration:
@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 <migueldoctor@gmail.com>
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 April 9, 2024 14:08
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',