Skip to content

Instantly share code, notes, and snippets.

View jordangray's full-sized avatar
💭
I may be slow to respond.

Jordan Gray jordangray

💭
I may be slow to respond.
View GitHub Profile
@jordangray
jordangray / dabblet.css
Created October 3, 2014 14:30
Warning folding
/* Warning folding */
.error {
background: #fcc;
border: 3px solid #c00;
border-radius: 5px;
margin: 1em 0;
padding: 10px;
position: relative;
width: 300px;
<ul class="products">
<li>
<a href="https://www.flickr.com/photos/35754040@N04/6786442153" title="DIY Two-Tone Cardigan by Stacie, on Flickr"><img src="https://farm8.staticflickr.com/7155/6786442153_217066b93b_s.jpg" width="75" height="75" alt="DIY Two-Tone Cardigan"></a>
<div class="text_holder">
<h3>Product name</h3>
<p class="description">Short description below product name</p>
<p class="price">$29.99<em>Was: $59.99</em></p>
</div>
</li>
@jordangray
jordangray / StringPluralisation.cs
Last active August 29, 2015 14:15
A handy utility for pluralising strings based on a numeric value, using standard English pluralisation rules by default.
public static class StringPluralisation
{
private static Regex ConsonantY = new Regex("([bcdfghj-np-tv-z]|qu)y$");
private static Regex Sibilant = new Regex("(s|z|sh|ch)$");
private enum PluralRule { Regular, Sibilant, ConsonantY }
private static PluralRule GetPluralRule(string noun)
{
if (Sibilant.IsMatch(noun)) return PluralRule.Sibilant;
@jordangray
jordangray / TypeUtil.js
Created February 25, 2015 00:32
A couple of useful utility functions for working with JS types.
;(function() {
var global = this;
// Get the default value for a named type (primitive name, 'function' or name of constructor).
function defaultValue(type) {
if (typeof type !== 'string') throw new TypeError('Type must be a string.');
@jordangray
jordangray / dabblet.css
Last active August 29, 2015 14:25
Untitled
html {
height: 100%;
}
body {
box-sizing: border-box;
font-family: "Open Sans";
height: 100%;
margin: 0;
padding: 10px 20px;
html {
height: 100%;
}
body {
box-sizing: border-box;
font-family: "Open Sans";
height: 100%;
margin: 0;
padding: 10px 20px;
@jordangray
jordangray / dabblet.css
Last active August 29, 2015 14:26
Disc nav on rainbow bg
/**
* Disc nav on rainbow bg
*/
html,
body {
background: #222 url(http://api.thumbr.it/whitenoise-200x200.png?background=22222200&noise=444444&density=20&opacity=20);
font-family: Segoe UI;
color: #fff;
margin: 0;
@jordangray
jordangray / dabblet.css
Last active August 29, 2015 14:27
Untitled
html {
height: 100%;
background: url(http://api.thumbr.it/whitenoise-200x200.png?background=4ea6ca00&noise=626262&density=45&opacity=10),
linear-gradient(15deg, hsla(10, 100%, 50%, 0.6), transparent 40%),
linear-gradient(-15deg, hsla(100, 80%, 30%, 0.6), transparent 40%),
linear-gradient(135deg, hsl(48, 100%, 84%) 10%, hsl(100, 50%, 50%) 30%, hsl(204, 47%, 45%) 50%, hsl(244, 27%, 55%) 80%);
}
body {
font-family: Segoe UI;
@jordangray
jordangray / dabblet.css
Created February 1, 2012 01:55
Untitled
h1 span {
display: block;
}
@jordangray
jordangray / dabblet.css
Created February 8, 2012 22:34
Messing about with keyframe animation
/**
* Messing about with keyframe animation
*/
@keyframes rot {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);