Skip to content

Instantly share code, notes, and snippets.

View AdrienPoupa's full-sized avatar

Adrien Poupa AdrienPoupa

View GitHub Profile
@AdrienPoupa
AdrienPoupa / wordpress-add-domain.md
Created July 23, 2020 20:30
WordPress: add text domain regex

Will replace: _e('text') to _e('text', 'your-domain')

_e:

Find \_e\('(.*)'\)

Replace by \_e\('$1', 'your-domain'\)

__:

@AdrienPoupa
AdrienPoupa / template.yaml
Created January 13, 2020 23:00
AWS ECS CloudFormation template modified to support several group IDs
AWSTemplateFormatVersion: '2010-09-09'
Description: >
AWS CloudFormation template to create a new VPC
or use an existing VPC for ECS deployment
in Create Cluster Wizard. Requires exactly 1
Instance Types for a Spot Request.
Parameters:
EcsClusterName:
Type: String
Description: >
@AdrienPoupa
AdrienPoupa / template.yaml
Created January 13, 2020 22:49
AWS ECS default CloudFormation template
AWSTemplateFormatVersion: '2010-09-09'
Description: >
AWS CloudFormation template to create a new VPC
or use an existing VPC for ECS deployment
in Create Cluster Wizard. Requires exactly 1
Instance Types for a Spot Request.
Parameters:
EcsClusterName:
Type: String
Description: >
@setup
require __DIR__.'/vendor/autoload.php';
$dotenv = Dotenv\Dotenv::create(__DIR__);
try {
$dotenv->load();
$dotenv->required(['DEPLOY_USER', 'DEPLOY_SERVER', 'DEPLOY_BASE_DIR', 'DEPLOY_REPO'])->notEmpty();
} catch ( Exception $e ) {
echo $e->getMessage();
}
@AdrienPoupa
AdrienPoupa / laravel_horizon.md
Created May 28, 2019 21:01 — forked from ankurk91/laravel_horizon.md
Laravel Horizon, redis-server, supervisord on Ubuntu server

Laravel Horizon, redis-server, supervisord on Ubuntu 16/18 server

Laravel 5.8, Horizon 3.x, Redis 5.x

Parepare application

  • Install and configure Laravel Horizon as instructed in docs
  • Make sure you can access the Horizon dashboard like - http://yourapp.com/horizon
  • For now it should show status as inactive on dashbaord

Install redis-server

Laravel
Replace old-style $_GET and $_POST by $request->input
Search: \$_POST\['(\w*)']
Replace: \$request->input('$1')
Replace isset(...) by $request->has
Search: isset\(\$_POST\['(\w*)']\)
@AdrienPoupa
AdrienPoupa / MoqExtensions.cs
Created June 20, 2017 09:11 — forked from jeremybeavon/MoqExtensions.cs
Moq support for ref and out callbacks
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Moq;
using Moq.Language;
using Moq.Language.Flow;