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
codfish / .php_cs.dist
Last active Aug 5, 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
codfish / dynamic_iframe_height.js
Last active Sep 16, 2015
Update the height of an iframe dynamically based on the height of the source content. Code is dependent on jQuery, and will only work when iframe is the same host/domain as the parent page, or if you have access to the content of the iframe. Reference:
View dynamic_iframe_height.js
// @example
// <iframe src="/form.html" id="infographic-iframe"></iframe>
document.getElementById('infographic-iframe').style.height = $('#infographic-iframe').contents().height() + 'px';
You can’t perform that action at this time.