Skip to content

Instantly share code, notes, and snippets.

View PhillipMwaniki's full-sized avatar
🤓
Who's checking ...

Phillip Mwaniki Nzuli PhillipMwaniki

🤓
Who's checking ...
View GitHub Profile
@thecodeholic
thecodeholic / php.json
Created February 26, 2024 19:29
PHP/Laravel Live snippets for VSCode
{
"Create public function": {
"prefix": "pubf",
"body": [
"public function $1()",
"{",
"\t$2",
"}",
],
"description": "Create public function"
@fabrizim
fabrizim / replace-bird-with-x.php
Last active May 28, 2024 09:00
Elementor: Replace Twitter Icon with new X Icon
<?php
add_filter( 'elementor/widget/render_content', function($output){
// replace the
$re = '/(<svg[^>]+class="[^"]*e-fab-twitter".*?<path\s+d=")(.+?)(".+?<\/svg>)/s';
$output = preg_replace_callback($re, function($matches){
$path = "M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z";
return $matches[1].$path.$matches[3];
}, $output);
return $output;
@AhmedHelalAhmed
AhmedHelalAhmed / index.md
Created February 11, 2022 14:54 — forked from meigwilym/index.md
Notes on stitcher.io's Laravel beyond CRUD

Laravel beyond CRUD

stitcher.io

A blog series for PHP developers working on larger-than-average Laravel projects

Written for projects with a development lifespan of six to twelve months, with a team of three to six developers working on them simultaneously.

Chapter 1: Domain oriented Laravel

@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active July 21, 2024 05:14
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@bcremer
bcremer / BaseTestCase.php
Created April 7, 2020 13:21
Reset PHPUnit testcase properties to save memory after each test.
<?php
abstract class BaseTestCase extends PHPUnit\Framework\TestCase
{
/**
* Reset the properties to save memory after each test.
* @see https://kriswallsmith.net/post/18029585104/faster-phpunit
*/
protected function tearDown(): void
{
#!/bin/bash
# Made by st0rmis
# Get the last tag, increment major, minor or patch version and push it
declare -a valid_versions=('major' 'minor' 'patch')
CURTAG=`git fetch --tags && git tag -l --sort=-creatordate | head -1`
CURTAG="${CURTAG/v/}"
IFS='.' read -a vers <<< "$CURTAG"
@ForeverZer0
ForeverZer0 / hosts
Last active December 16, 2019 12:15
Block Spotify Ads
############## SPOTIFY ###################
127.0.0.1 media-match.com
127.0.0.1 adclick.g.doublecklick.net
127.0.0.1 www.googleadservices.com
127.0.0.1 pagead2.googlesyndication.com
127.0.0.1 googleads.g.doubleclick.net
127.0.0.1 pubads.g.doubleclick.net
127.0.0.1 securepubads.g.doubleclick.net
127.0.0.1 www.omaze.com
127.0.0.1 omaze.com
@PhillipMwaniki
PhillipMwaniki / countries.sql
Created July 23, 2018 09:48 — forked from adhipg/countries.sql
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@sdavara
sdavara / Git-Pre-commit-setup.md
Last active July 25, 2023 16:36
Git-pre-commit-hooks for PHP/Laravel Project

Pre Commit Setup

Setup pre-commit hook in php projects for lint, code standard, test cases etc.

Prerequisites

  • php >= 5.6
  • composer
  • git

Installation