Skip to content

Instantly share code, notes, and snippets.

View gemmadlou's full-sized avatar

Gemma Black gemmadlou

View GitHub Profile
@gemmadlou
gemmadlou / 01-introduction.md
Last active May 3, 2024 06:38
WordPress Composer Starter (Steps)

Develop WordPress as a Modern PHP Project with Composer


WordPress is popular because it's easy to setup without much technical know-how. However, to build a more robust PHP project with command line deployments, updates and ongoing maintenance, working with WordPress out-of-the-box raises specific challenges:


  • How can we make our WordPress projects portable between developers?
@gemmadlou
gemmadlou / remove-visual-composer-shortcodes.md
Last active April 20, 2024 14:56
Removing Visual Composer & Shortcodes From Wordpress Content

Adding @k1sul1's suggestion from the comments as it's more concise than what I had before:

I just wanted them all gone, so I ran this in the MySQL shell.

UPDATE wp_posts SET post_content = REGEXP_REPLACE(post_content, "\\[\/?vc(.*?)\]", "");

Note the double backslash. If you forget it, you'll replace all v's and c's with nothing, and the shortcodes will still be there. This works for other shortcode as well, just replace vc.

@gemmadlou
gemmadlou / multiple_ssh_setting.md
Created May 17, 2023 15:51 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"

Install MySQL

See what formula are available.

brew search mysql
==> Formulae
@gemmadlou
gemmadlou / example-01.ts
Last active February 7, 2023 20:40
Chain of Responsibility Pattern With Typescript - Adding Conditionals Together
/*
Example 01
Business Says
-------------
We only want scores of 4 and above
Developer Says
--------------
Simples. So we use an if statement.
@gemmadlou
gemmadlou / nginx.conf
Created October 23, 2022 09:12 — forked from ashleydw/nginx.conf
Laravel nginx conf file
server {
listen 80 default_server;
server_name example.com www.example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /srv/www/example.com/public;
index index.php index.html;
@gemmadlou
gemmadlou / buildspec.yml
Created November 8, 2019 18:36
Npm install private CodeCommit repositories using SSH
version: 0.2
phases:
install:
commands:
- "which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )"
pre_build:
commands:
- aws --version
- git --version
@gemmadlou
gemmadlou / functions.js
Last active April 6, 2021 02:20
Dreaming Whilst Black
<script>
// Production steps of ECMA-262, Edition 6, 22.1.2.1
if (!Array.from) {
Array.from = (function () {
var toStr = Object.prototype.toString;
var isCallable = function (fn) {
return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
};
var toInteger = function (value) {
@gemmadlou
gemmadlou / 1.ProcessClass.php
Created February 24, 2021 15:10 — forked from jeffochoa/1.ProcessClass.php
Understanding Laravel pipelines
<?php
namespace App\Features;
use App\Features\FirstTask;
use App\Features\SecondTask;
use Illuminate\Pipeline\Pipeline;
// *Naming things is hard* ... So, this is a class called `ProcessClass` that `run()` some text ¯\_(ツ)_/¯
class ProcessClass
@gemmadlou
gemmadlou / git.migrate
Created February 19, 2021 12:51 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.