Skip to content

Instantly share code, notes, and snippets.

View williamdodson's full-sized avatar
🏠
Working from home

William Dodson williamdodson

🏠
Working from home
View GitHub Profile
var docWidth = document.documentElement.offsetWidth;
[].forEach.call(
document.querySelectorAll('*'),
function(el) {
if (el.offsetWidth > docWidth) {
el.style.border = "1px solid red";
console.log(el);
}
}
@williamdodson
williamdodson / macos-change-screenshot-folder.sh
Created December 16, 2016 20:43
Changes the default location for screenshots on macOS
defaults write com.apple.screencapture location ~/Desktop/Screenshots;killall SystemUIServer
@williamdodson
williamdodson / settings.php
Last active December 1, 2016 18:12
Disable caching, preprocessing, and SSL for local site in Drupal
<?php
/**
* Add the following lines to the end of your sites/default/settings.php file
* to disable caching, preprocessing CSS/JS files, and disable SSL
*/
$conf['securepages_enable'] = FALSE;
$conf['cache'] = FALSE;
$conf['block_cache'] = FALSE;
$conf['preprocess_css'] = FALSE;
$conf['preprocess_js'] = FALSE;
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
</head>
<body>
</body>
</html>
Verifying that +williamdodson is my blockchain ID. https://onename.com/williamdodson
@williamdodson
williamdodson / plugin.get-input-type.js
Created December 7, 2015 15:56
jQuery plugin to return a given input type as a string (e.g. "textarea").
/**
* Function getInputType
*
* @return String name for the type of input (i.e. select or textarea)
* @example <code>var inputType = $(input).getInputType(); // returns a string representation of the given input</code>
* @author William Dodson <william.dodson@gmail.com>
* @version 1.0.0
*/
(function ($) {
'use strict';
// strip-units required by spread mixin
// http://stackoverflow.com/questions/12328259/how-do-you-strip-the-unit-from-any-number-in-sass
@function strip-units($number)
@return $number / ($number * 0 + 1)
// pow and sqrt required by ease function
// adapted from https://github.com/at-import/Sassy-math/blob/master/sass/math.scss
@function pow($base, $exponent)
$value: $base
@williamdodson
williamdodson / gist:277f830a57c6215a127c
Last active August 29, 2015 14:02
WP Search Exclude Change
<?php
/* ORIGINAL: search-exclude.php Line 119 */
public function searchFilter($query)
{
if ($query->is_search) {
$query->set('post__not_in', array_merge($query->get('post__not_in'), $this->getExcluded()));
}
return $query;
}
@williamdodson
williamdodson / Social Media Brand Colors
Last active August 29, 2015 13:57
Social media branding colors. I'll update this Gist as I gather more and feel free to fork and collaborate.
Dribbble: #C73B6F
Facebook: #3B5998
Flickr: #FE0883
Forrst: #3B7140
Foursquare: #8FD400
GitHub: #4183C4
Google+: #C63D2D
Instagram: #4E433C
Linkedin: #4875B4
Tumblr: #2B4964