Skip to content

Instantly share code, notes, and snippets.

@benhodgson87
benhodgson87 / countries.simple.json
Created June 10, 2014 16:56
Countries JSON (Simple)
{
"AF": {
"name": "Afghanistan"
},
"AX": {
"name": "Åland Islands"
},
"AL": {
"name": "Albania"
},
@benhodgson87
benhodgson87 / _icons.scss
Last active August 29, 2015 14:04
ng-store Icon Sass-Map refactor
// 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",
// 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 });
[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,
[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,
@benhodgson87
benhodgson87 / rgba-fallback.scss
Last active December 29, 2015 17:29
Sass RGBA Fallback Mixin
/**
* 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
benhodgson87 / dateformat.html
Last active December 31, 2015 00:39
Date formatting function for Example ballot
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<div id="date"></div>
</body>
@benhodgson87
benhodgson87 / Crowdsurge .gitignore
Last active December 31, 2015 17:38
.gitignore Boilerplate for Crowdsurge Repos
# .gitignore Boilerplate
#
# For noise that might accidentally end up in Repos
# And anything that should be in S3
# -------------------------------------------------
# Noise
# -----
@benhodgson87
benhodgson87 / BasicField.js
Created February 21, 2018 16:54
Reusable React/Redux-Form Layout using HOC
/**
* Basic input field wrapped with FormField HOC
*/
import React from 'react'
import PropTypes from 'prop-types'
import FormFieldWrapper from './FormFieldWrapper'
import './BasicField.css'
@benhodgson87
benhodgson87 / bottle_status_logic.js
Last active May 31, 2018 19:03
Bottle Status Logic
// source http://jsbin.com/mokikomobe
const current_bottle_weight = 1120;
const empty_bottle_weight = 649;
const full_bottle_weight = 1357;
const full_bottle_ml = 700;
const full_bottle_volume = full_bottle_weight - empty_bottle_weight;
@benhodgson87
benhodgson87 / countries.json
Last active January 19, 2019 18:02
Countries JSON
{
"AD": {
"currency": {
"primary": "EUR"
},
"iso": {
"code2": "AD",
"code3": "AND",
"num": "020"
},