Skip to content

Instantly share code, notes, and snippets.

View craigbutcher's full-sized avatar

Craig Butcher craigbutcher

View GitHub Profile
@craigbutcher
craigbutcher / pull_json.sh
Last active June 19, 2017 09:58
Curl to pull down jsons
curl "https://api.github.com/users/craigbutcher/gists" | python -m json.tool | pbcopy
@craigbutcher
craigbutcher / truncate.css
Created August 10, 2015 08:26
Truncate String with Ellipsis
/*
* Accessibility wise, it may bring up various issues.
*
* Long file names with similar names, for example:
*
* + Gauntlet I - In The Beginning - becomes - Gauntlet I
* + Gauntlet II - In The Middle - becomes - Gauntlet I...
* + Gauntlet III - In The End - becomes - Gauntlet I...
*
* The only way to overcome this is to either produce shorter titles
@craigbutcher
craigbutcher / global.js
Created August 7, 2015 14:28
Checking for spaces and replacing them with HTML URL encoding %20
// Get the href path
var path = linkClicked.attr('href');
// Does it contain spaces? If so, convert them to HTML URL Encoding Reference - %20
path = path.replace(/ +/g, '%20');
@craigbutcher
craigbutcher / ordered-list.css
Created August 3, 2015 15:03
A Better Ordered List (ABOL)
ol {
counter-reset: item;
margin: 0 0 20px 20px;
}
ol li {
display: block;
position: relative;
}
@craigbutcher
craigbutcher / select-placeholder.html
Created July 28, 2015 10:17
Placeholder for select box.
<select>
<option value="" disabled selected>Select your option:</option>
<option value="One">One</option>
<option value="Two">Two</option>
<option value="Three">Three</option>
</select>