Skip to content

Instantly share code, notes, and snippets.

View omitobi's full-sized avatar
👑
The faithful shall receive the crown of life from Jesus

Oluwatobi Samuel Omisakin omitobi

👑
The faithful shall receive the crown of life from Jesus
View GitHub Profile
@ulcuber
ulcuber / RetryAllFailedJobsCommand.php
Created October 26, 2022 15:34
Laravel Horizon. Retry all of the failed jobs like one in the horizon dashboard
<?php
namespace App\Console\Commands\Horizon;
use Illuminate\Console\Command;
use Illuminate\Queue\Failed\FailedJobProviderInterface;
use Laravel\Horizon\Contracts\JobRepository;
use Laravel\Horizon\Jobs\RetryFailedJob;
class RetryAllFailedJobsCommand extends Command
@bseddon
bseddon / subtle-sign-verify-x509.md
Last active September 13, 2023 08:05
Using crypto.subtle to sign text and verify a signature using an external asymmetric key pair

Subtle is the modern way to perform cryptographic task in JavaScript. However, examples provided in the Mozilla documentation or in their GitHub pages only show how to use the subtle functions to sign text and verify signatures using a key pair generated by subtle.

In my use case the key pair MUST be generated a recognised authority so how can the CryptoKey required by the subtle Sign and Verify functions be created from an external source. On this the documentation and examples are not very helpful so this gist provides a worked example showing how to do it.

Use case

In my case a signature is to be added to a document in the manner specified by XAdES which is defined by ETSI on behalf of the EU commission. The public key of the key pair used MUST be pa

@zaratedev
zaratedev / .env.ci
Created August 31, 2020 18:55
Github actions for Laravel dusk
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://127.0.0.1:8000
BCRYPT_ROUNDS=4
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
@jpswade
jpswade / php7.4-fpm-alpine
Last active September 9, 2023 20:43
PHP 7.4 PHP-FPM Alpine with core extensions gd
FROM php:7.4-fpm-alpine
# @see https://hub.docker.com/r/jpswade/php7.4-fpm-alpine
MAINTAINER Agent Software <dev@agentsoftware.net>
# Install gd, iconv, mbstring, mysql, soap, sockets, zip, and zlib extensions
# see example at https://hub.docker.com/_/php/
RUN apk add --update \
$PHPIZE_DEPS \
freetype-dev \
git \
@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:
@silver-xu
silver-xu / ts-boilerplate.md
Last active May 3, 2024 14:01
Setup a Node.js project with Typescript, ESLint, Prettier, Husky

Setup a Node.js project with Typescript, ESLint, Prettier, Husky

1_D8Wwwce8wS3auLAiM3BQKA

Starting a personal node project could be easy; starting a team node project could be challenging.

I am a developer currently working in SEEK Australia.

In my experience, common mistakes developer make when starting a projects are:

  • No Linting
@arthursalvtr
arthursalvtr / add-custom-mail-driver-to-laravel.md
Last active April 5, 2024 17:43
Add Custom Mail Driver to Laravel

How to add custom Mail Driver to Laravel

Tested on Laravel 5.8

Within the source code of laravel 5.8 at this time of writing, we have this following

<?php

namespace Illuminate\Support;
@estorgio
estorgio / prettier-eslint-precommit.md
Last active April 21, 2024 09:52
Setting up Prettier and ESLint with pre-commit hook

Setting up Prettier and ESLint with pre-commit hook

  • Initialize Git repository
    git init
  • Create .gitignore file and add the following:
    node_modules/
    *.env
    
@bradtraversy
bradtraversy / docker_wordpress.md
Last active May 4, 2024 09:16
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@tonila
tonila / CustomBuilder.php
Last active September 9, 2020 12:12
Mass (bulk) insert or update on duplicate for Laravel 5.x
<?php
namespace App\Classes\Database;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Arr;
class CustomBuilder extends Builder
{
public function insertOrUpdate(array $values)