Skip to content

Instantly share code, notes, and snippets.

Chris O'Donnell codfish

Block or report user

Report or block codfish

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Xdebug tends to slow down a lot of things. Here's a hack to unload the extension by default but load it whenever it's needed (for instance, when generating php code coverage.

Prevent Xdebug from loading by default

If you use brew to install php 7, should be here: /usr/local/etc/php/<version>/conf.d/ext-xdebug.ini. Edit that file (replacing <version> with whatever version of php you're using) and comment out the line that begins with zend_extension. The code examples here assume 7.0.

codfish / .php_cs.dist
Last active Nov 12, 2019
PHP-CS-Fixer configuration file. PSR-2 plus some opinionated options to make code cleaner.
View .php_cs.dist
* Rules we follow are from PSR-2 as well as the rectified PSR-2 guide.
* -
* -
* -
* If something isn't addressed in either of those, some other common community rules are
codfish / index.html
Last active Nov 20, 2017
AngularJS 1.x Slick Carousel Directive
View index.html
<div class="slick-slider clearfix"
codfish / app-controller.js
Created Nov 20, 2017
AngularJS 1.X Meta Service
View app-controller.js
* Application Controller
* @ngInject
function AppCtrl($rootScope, $log, $state, MetaService, configuration) {
$rootScope.$on('$stateChangeSuccess', function(event, state, params, from, fromParams) {
// set canonical based on the new state url & param values
MetaService.canonical = configuration.DOMAIN_HOST + $state.href(state, params);
codfish / no-js-no-styles.scss
Last active Sep 21, 2017
Remove site styles when js is not supported
View no-js-no-styles.scss
// when using modernizr or similar
.no-js body * {
display: initial !important;
opacity: 1 !important;
visibility: visible !important;
overflow: visible !important;
transform: none !important;
float: none !important;
position: static !important;
height: auto !important;
codfish /
Last active May 2, 2017
List of useful web development related services & tools.
codfish /
Last active Dec 2, 2018
Dev Resources & Reference

Here are some sites with useful developer tools & reference material. Some of them are simple links to the original source, while some are also elaborated on below for quick & helpful reference.

  • Cheat Sheets -- Source
  • HEAD: A list of everything that could go in the head of your document -- Source
  • We serve fast and scalable informational images as badges for GitHub, Travis CI, Jenkins, WordPress and many more services. Use them to track the state of your projects, or for promotional purposes. -- Source
  • Storybook: The UI Development Environment. -- Source
  • Branching & Release Strategy -- Source
  • Probot: GitHub Apps to automate and improve your workflow. Use pre-built apps to extend GitHub, and easily build and share your own. -- [Source](https://probot.gith
codfish /
Created May 24, 2016
Get an alphabetical list of files that a specific string is found within your repo
git grep '<string to search for>' | awk '{print $1}' | sed 's/:$//' | sort -u
codfish / search_multi_array.php
Created May 16, 2016
Search multi-dimensional array based on key value pair. i.e. you have an array of posts, and you want to return the post with the id of `1231`
View search_multi_array.php
$posts = [
'id' => 1231,
'title' => 'Test'
'id' => 1111,
'title' => 'Test #2'
codfish /
Last active Mar 11, 2016
Download wedding photos. Photographer put all of our photos for us and family to buy, but wasn't going to give us a digital copy. So...
#!/usr/bin/env bash
# need to set env variable for the public base url for the photos
if [[ -z "$WEDDING_URL_PREFIX" ]]; then
printf '\nError: WEDDING_URL_PREFIX needs to be set in your environment!\n'
exit 1
# image filenames had two different prefixes
You can’t perform that action at this time.