Skip to content

Instantly share code, notes, and snippets.

View beaucharman's full-sized avatar
💭
🦄 Hackin'

Beau beaucharman

💭
🦄 Hackin'
View GitHub Profile

Accessibilty Considerations

Images

  • Provide Alt attributes to describe what the subject of the image asset is.
  • Informative and descriptive file name (Great for SEO too :D).
  • For images that are for pure decoration, apply alt="null" and do not provide a title attribute to mark as safely ignore for Assistive Technology.

Anchors

@beaucharman
beaucharman / gist:e13ecd69ae3ed4fe6510
Last active August 29, 2015 14:06
Terminal Awesomness
sudo nano ~/.bash_profile
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
PS1='\e[0;35m⌘\e[0;34m \w/\e[0m\e[0;32m$(parse_git_branch)\e[0m '
alias projectlt3="cd ~/Sites/lt3-development/"
@beaucharman
beaucharman / reclaim.txt
Created January 21, 2015 12:48
To reclaim ownership of the .npm directory execute `sudo chown -R $(whoami) ~/.npm`
// To reclaim ownership of the .npm directory execute
sudo chown -R $(whoami) ~/.npm
@beaucharman
beaucharman / event.js
Last active December 14, 2015 18:09
event{} | JavaScript object | Cross Browser Event Handling
/**
* Event
* ------------------------------------------------------------------------
* event{}
* @version 1.0 | April 23rd 2013
* @author Beau Charman | @beaucharman | http://beaucharman.me
* @link https://gist.github.com/beaucharman/5127116
* @method add
* @method remove
* @method getTarget
@beaucharman
beaucharman / ajax.demo.js
Last active December 16, 2015 05:29
ajax{} | JavaScript object | AJAX methods object
// examples
;(function () {
ajax.json('file.php', {best: "cats", awesome: "javascript"}, function (json) {
var foo = document.getElementById('foo');
for (var ii = 0, len = json.length; ii < len; ii++) {
foo.innerHTML += '<li>' + json[ii].name + ': ' + json[ii].details + '</li>';
}
});
@beaucharman
beaucharman / roundTo.js
Last active December 16, 2015 07:49
roundTo( ) | JavaScript function | A JavaScript function that returns a float to a given number of decimal places, can also transpose the decimal place if needed.
/**
* RoundTo
* ------------------------------------------------------------------------
* roundTo()
* @version 1.0 | April 18th 2013
* @author Beau Charman | @beaucharman | http://www.beaucharman.me
* @link https://gist.github.com/beaucharman/5401683
* @param {float} n | the subject number we are rounding
* @param {integer} d | the number to decimal places to round to
* @param {string} dir | 'round', 'floor' or 'ceil'
@beaucharman
beaucharman / equalHeight.js
Last active December 20, 2015 03:59
Apply equal height to a group of provided elements, based on the tallest element
/**
* Equal Height
* ======================================================================== */
(function ($) {
$.fn.equalheight = function () {
var tallest = 0;
var height = 0;
//var offest = 0;
var $elements = $(this);
var resizeElements = function () {
@beaucharman
beaucharman / getQueryVars.js
Last active December 20, 2015 18:19
getQueryVars.js
/**
* Get Query Vars
*/
var getUrlVars = function () {
var vars = [];
var hash;
var href = window.location.href;
if (href.indexOf('#') !== -1) {
href = href.substr(0, href.indexOf('#'));
}
/**
* accessibleDropDownMenu.js
*
* jquery.accessibleDropDownMenu.js
* @version 2.0 | 14th January 2014
* @author Beau Charman | @beaucharman | http://www.beaucharman.github.io
* @link https://gist.github.com/beaucharman/7348970 |
* http://jsfiddle.net/beaucharman/X2ArC/
* @license MIT license
*/
@beaucharman
beaucharman / jquery.equalHeightColumns.js
Last active December 31, 2015 09:49
Responsive, Equal Height Columns
/**
*
* Equal Height Columns
*
* Horizontally Even Columns
*
* @param {object}
* @param {boolean} 'responsive'
* @param {integer} 'responsiveDelay'
* @param {string} 'bindTo'