Skip to content

Instantly share code, notes, and snippets.

Ben Hodgson benhodgson87

Block or report user

Report or block benhodgson87

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
benhodgson87 / rgba-fallback.scss
Last active Dec 29, 2015
Sass RGBA Fallback Mixin
View rgba-fallback.scss
* RGBA & Hex Fallback
* Takes a hex code with comma separated alpha value.
* Falls back to just the hex if no alpha is provided.
* Params:
* $prop: The CSS property to apply the color value to
* $color: A hex code, or bracketed Hex + Opacity figure. eg: (#fff, 0.5)
benhodgson87 / dateformat.html
Last active Dec 31, 2015
Date formatting function for Example ballot
View dateformat.html
<!DOCTYPE html>
<script src=""></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<div id="date"></div>
benhodgson87 / Crowdsurge .gitignore
Last active Dec 31, 2015
.gitignore Boilerplate for Crowdsurge Repos
View Crowdsurge .gitignore
# .gitignore Boilerplate
# For noise that might accidentally end up in Repos
# And anything that should be in S3
# -------------------------------------------------
# Noise
# -----
benhodgson87 / decimalFormat.js
Last active Jul 31, 2017
DecimalFormat Currency Formatting
View decimalFormat.js
Number.prototype.currency = function (format) {
var amt = this, neg;
// If no formatting string supplied
// or amount is not a number, return as is
if (!format || isNaN(amt)) return amt;
// Extract placeholders from format string
var formFig = format.match(/\#(.*)\#/g).pop();
View countries.json
"AD": {
"currency": {
"primary": "EUR"
"iso": {
"code2": "AD",
"code3": "AND",
"num": "020"
View countries.simple.json
"AF": {
"name": "Afghanistan"
"AX": {
"name": "Åland Islands"
"AL": {
"name": "Albania"
benhodgson87 / _icons.scss
Last active Aug 29, 2015
ng-store Icon Sass-Map refactor
View _icons.scss
// Setup an icon array of name modifer keys + content values
// eg. "pencil": "\e602"; becomes a class of .icon--pencil
$icon-types: (
"pencil": "\e602",
"ticket": "\e60d",
"cart2": "\e60f",
"credit": "\e627",
"location": "\e612",
"map": "\e634",
"clock": "\e614",
View gist:a66e461abae4f10032f7
// Transmitter
var storedHeight = 0, payload;
setInterval(function() {
var currentHeight = $('.ng-scope').height();
if (currentHeight == storedHeight) {
return false;
} else {
storedHeight = currentHeight;
payload = JSON.stringify({ height: currentHeight });
View ryanair.css
[core-date-range] [core-morph-popup] .content-box .footer .btn.close.disabled,
[core-date-range] [core-morph-popup] .content-box .footer,
[core-date-range] [core-morph-popup] .content-box .footer .btn.close.disabled.focus,
[core-date-range] [core-morph-popup] .content-box .footer .btn.close.disabled:active,
[core-date-range] [core-morph-popup] .content-box .footer .btn.close.disabled:focus,
[core-date-range] [core-morph-popup] .content-box .footer .btn.close.disabled:hover,
[core-date-range] [core-morph-popup] .content-box .footer .btn.close[disabled],
[core-date-range] [core-morph-popup] .content-box .footer .btn.close[disabled].active,
[core-date-range] [core-morph-popup] .content-box .footer .btn.close[disabled].focus,
[core-date-range] [core-morph-popup] .content-box .footer .btn.close[disabled]:active,
View beer-names.txt
Bitter Sweet Symphony (Andy Mitchell)
Lager John Misty (Ben Hodgson)
Top of the Hops (Andy Mitchell)
Mumford & Tuns (Ben Hodgson)
More Fire Brew (Alex Reade)
Malt-J (Ewan Eyre)
Kendrink Lager (Ben Hodgson)
A$AP Hoppy (Ben Hodgson)
Weird Ale Yankovic (Alex Reade)
The Boy Yeast Likely To (Ewan Eyre)
You can’t perform that action at this time.