Skip to content

Instantly share code, notes, and snippets.

Avatar
🐘
Herding 🐘

Juliette jrfnl

🐘
Herding 🐘
View GitHub Profile
View time-travel.md

Time Travel Debugging

Time Travel refers to the ability to record a tab and later replay it ([WebReplay][wrr]). The technology is useful for local development, where you might want to:

  • pause and step forwards or backwards
  • pause and rewind to a prior state
  • rewind to the time a console message was logged
  • rewind to the time an element had a certain style or layout
  • rewind to the time a network asset loaded
@Rarst
Rarst / .scrutinizer.yml
Last active Aug 13, 2019
Scrutinizer config to install PHPUnit on the fly, without shipping in project dependencies.
View .scrutinizer.yml
filter:
excluded_paths:
- 'tests/*'
checks:
php: true
build:
environment:
php:
version: 7.2
dependencies:
@mlocati
mlocati / exceptions-tree.php
Created Mar 9, 2017
Throwable and Exceptions tree
View exceptions-tree.php
<?php
if (!function_exists('interface_exists')) {
die('PHP version too old');
}
$throwables = listThrowableClasses();
$throwablesPerParent = splitInParents($throwables);
printTree($throwablesPerParent);
if (count($throwablesPerParent) !== 0) {
die('ERROR!!!');
@DragonBe
DragonBe / php_conferences_2016.md
Last active Feb 9, 2018
Overview of PHP oriented conferences in 2016 (excluding polyglot and framework oriented conferences)
View php_conferences_2016.md
@matheuseduardo
matheuseduardo / get-page-by-slug.php
Last active Apr 6, 2021 — forked from micahblu/gist:5786794
get_page_by_slug - wordpress
View get-page-by-slug.php
<?php
/**
* Retrieve a page given its slug.
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $page_slug Page slug
* @param string $output Optional. Output type. OBJECT, ARRAY_N, or ARRAY_A.
* Default OBJECT.
* @param string|array $post_type Optional. Post type or array of post types. Default 'page'.
@Rarst
Rarst / append.php
Last active Apr 27, 2016
My xhprof/uprofiler setup, tweaked for WordPress and more easily profiling segments.
View append.php
<?php
use Rarst\Profiler\Handler;
global $wp;
if ( Handler::$profiling && empty( $wp ) ) {
Handler::close();
}
@barrykooij
barrykooij / release-wpseo.sh
Last active Aug 29, 2015
The WordPress SEO Release script
View release-wpseo.sh
#!/bin/sh
# License: GPL v3
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
@szepeviktor
szepeviktor / wp-badrequest.php
Last active Dec 29, 2018
WordPress bad request - help Fail2ban to ban "deadly" requests
View wp-badrequest.php
MOVED to: https://github.com/szepeviktor/wordpress-fail2ban/tree/master/block-bad-requests
@ryansechrest
ryansechrest / server-to-localhost.sh
Created Dec 23, 2013
Bash script to synchronize website directory and database between server and localhost or server and server.
View server-to-localhost.sh
#!/bin/bash
# Created on 10/8/13 by Ryan Sechrest
# site (localhost edition)
# Program to mirror a directory and database of a website between two servers.
### Program meta data
@ryansechrest
ryansechrest / post-receive.sh
Last active Feb 12, 2017
Git post-receive hook to deploy WordPress and plugins as submodules. It can also install Node.js modules with npm and vendor packages with Composer.
View post-receive.sh
#!/bin/bash
# Created on 7/17/13 by Ryan Sechrest
# Deploys pushed branch from the origin repository to the web directory
if [[ (-n $1) && (-n $2) && (-n $3) ]]; then
# Set path to project directory
project_path="/var/www/domains/$2/$3"