Skip to content

Instantly share code, notes, and snippets.

View faffyman's full-sized avatar
💭
I may be slow to respond.

Tim Swann faffyman

💭
I may be slow to respond.
View GitHub Profile

Below is a list of useful libraries and tools for PHP centric web dev, started out as a shortend list based on Awesome PHP but has since grown with other libs I've found to be useful over the years.

You can should always go check Awesome PHP as well see what's been update or to find anything that isn't here.

A.I. Generative Artificial Intelligence

Document Management

Libraries and software for working with PDF files.

@faffyman
faffyman / TwigExtension.php
Created February 22, 2018 10:08
Some Useful Twig Filters & Functions
<?php
/**
* @file src/Twig/TwigExtension.php
**/
namespace App\Twig;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;
@faffyman
faffyman / MySymfonyTest.php
Last active April 19, 2017 10:23
PHP Unit testing with Codeception: Useful hints
<?php
namespace AppBundle;
use Codeception\Util\Debug;
use Doctrine\ORM\EntityManager;
class MySymfonyTest extends \Codeception\Test\Unit
{
@faffyman
faffyman / wpwatcher.py
Last active May 12, 2019 20:39 — forked from Neo23x0/wpwatcher.py
Wordpress Watcher - WPScan Vulnerabilty Scan on Wordpress Sites and Reporting
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# -*- coding: utf-8 -*-
#
# Wordpress Watcher
# Automating WPscan to scan and report vulnerable Wordpress sites
# Forked from https://gist.github.com/Neo23x0/2a97509f50c57a2e737e
# v0.1.1
# March 2017
#
@faffyman
faffyman / wordpress-vagrant-ngrok.md
Created February 28, 2017 15:29
Use ngrok to expose a wordpress local dev site

First - Install NPM on the Vagrant VM

$ vagrant ssh
$ sudo apt-get install python-software-properties
$ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -

$ sudo apt-get install nodejs

Install ngrok

@faffyman
faffyman / functions.php
Created January 23, 2017 14:29
Wordpress - Sort Admin Table Column by Taxonomy
// functions.php
/**
* Snippet to create allow a custom admin column to be sortable when it uses Taxonomy terms
**/
if(!function_exists('sz_sort_POSTNAME_by_COLUMN-NAME')){
function sz_sort_POSTNAME_by_COLUMN-NAME($clauses, $wp_query){
global $wpdb;
if(isset($wp_query->query['orderby']) && $wp_query->query['orderby'] == 'YOUR ORDERBY FIELD'){
@faffyman
faffyman / gist:2de92857e6ff11f07280
Created October 1, 2014 20:47
Server Provisioning Recipe
# Update packages
apt-get update
apt-get upgrade -y
# Add A Few PPAs To Stay Current
apt-get install -y software-properties-common
apt-add-repository ppa:nginx/stable -y
@faffyman
faffyman / vbox-tips.md
Last active August 29, 2015 14:00
Virtual Box Hints & Tips

List VMS at the command line

VBoxManage list vms

This should show something like:-

  • "IE11 - Win8.1" {054501a7-7636-407a-b124-9b6c9724ffa4}
  • "IE6 - WinXP" {f3fab135-8b15-4b6a-a446-d747854d9688}
  • "<inaccessible>" {c7601a5b-eef7-4660-8fdc-a9fbc8dab9d3}
@faffyman
faffyman / apache.sh
Created November 13, 2013 17:42
Reminder hint list of Unix commands for working with apache
# enable a site
sudo a2ensite
# disable a site
sudo a2dissite
# enable an apache2 module
sudo a2enmod
# a2enmod [modulename]
@faffyman
faffyman / Urlize.php
Last active December 23, 2015 18:19
A view helper for ZF2 (Zend Framework 2) This view helper will "urlize" a word or phrase to make it "safer" as a url slug. e.g. It's Séan's Party becomes its-seans-party
<?php
namespace Application\View\Helper;
use Zend\View\Helper\AbstractHelper;
class Urlize extends AbstractHelper
{
public function __invoke($string)
{