Skip to content

Instantly share code, notes, and snippets.

View ulcuber's full-sized avatar

Victor S. ulcuber

  • FrameWorkTeam
  • GMT+4
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
<?php
namespace App\Console\Commands;
use RuntimeException;
use Illuminate\Support\Str;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
#!/bin/bash
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
BASE=./bin
rm $BASE/chromedriver
wget -N http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -P $BASE/
unzip $BASE/chromedriver_linux64.zip -d $BASE/
rm $BASE/chromedriver_linux64.zip
@ulcuber
ulcuber / deploy.bash
Last active October 30, 2019 11:29
laravel forge common deploy
if [ -f artisan ]
then
php artisan down --message="Upgrading" --retry=60
# to prevent missing providers/services when optimizing autoloader
# php artisan view:clear
# php artisan cache:clear
# php artisan route:clear
# php artisan config:clear
# php artisan clear-compiled
@ulcuber
ulcuber / .phpcs.xml
Created October 27, 2019 10:27
PSR12 laravel phpcs config
<?xml version="1.0"?>
<ruleset name="Laravel Standards">
<description>The Laravel Coding Standards</description>
<file>app</file>
<file>config</file>
<file>resources</file>
<file>routes</file>
<file>tests</file>
@ulcuber
ulcuber / .eslintrc.js
Last active September 24, 2023 18:14
eslint config for laravel-mix with vue
const OFF = 'off';
const WARN = 'warn';
const ERROR = 'error';
const MAX_COMPLEXITY = 11;
module.exports = {
root: true,
env: {
node: true,
},
@ulcuber
ulcuber / .eslintrc.js
Created October 27, 2019 10:18
eslint config for laravel-mix without vue
const OFF = 'off';
const WARN = 'warn';
const ERROR = 'error';
module.exports = {
root: true,
env: {
node: true,
browser: true,
},
<?php
/**
* Usage: dumpBacktrace(debug_backtrace(), 3);
*/
function dumpBacktrace($b, int $count = null): void
{
$count = is_int($count) ? $count : count($b);
for ($i = $count - 1; $i >= 0; --$i) {
dump(($b[$i]['class'] ?? '') . '@' . $b[$i]['function']);
@ulcuber
ulcuber / SSR_starters.md
Last active May 14, 2019 15:38
Compare create-react-app | create-next-app | create-razzle-app
scripts create-react-app create-next-app create-razzle-app
dev server npm start npm run dev npm start
prod server - npm run start npm run start:prod
build npm run build npm run build npm run build
test npm test - npm test
eject npm run eject - -
features create-react-app create-next-app create-ruzzle-app
@ulcuber
ulcuber / regexp.php
Created March 23, 2019 05:53
using cyrillic in php regexp
<?php
/*
* about task
* strings like "Artist1 & Artist2" or "Artist1 feat. Artist2" or "Исполнитель1 и Исполнитель2"
* are splited into ["Artist1", "Artist2"]
*/
/*
* using modifier u (PCRE_UTF8) to include cyrillic in regexp
* @see http://php.net/manual/en/reference.pcre.pattern.modifiers.php