This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(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.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Warning folding */ | |
.error { | |
background: #fcc; | |
border: 3px solid #c00; | |
border-radius: 5px; | |
margin: 1em 0; | |
padding: 10px; | |
position: relative; | |
width: 300px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Collapsing warnings */ | |
.error { | |
background: #fcc; | |
border: 3px solid #c00; | |
border-radius: 5px; | |
margin: 1em 0; | |
padding: 10px; | |
position: relative; | |
width: 300px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Warning sign */ | |
.icon-warning-sign { | |
position: relative; | |
} | |
.icon-warning-sign:before { | |
left:0; | |
content: ""; | |
width: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.icon-warning-sign { | |
position: relative; | |
} | |
.icon-warning-sign:before { | |
left:0; | |
content: ""; | |
width: 0; | |
height: 0; | |
border-style: solid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Regex ParseUrl = new Regex(@"(?:^\w*:?//)? # Protocol | |
(?<domain> [\.\w]+) # Domain | |
(?::\d)? # Port | |
(?:/.*)? # Path", | |
RegexOptions.IgnoreCase | | |
RegexOptions.IgnorePatternWhitespace); | |
// Example usage | |
var domain = ParseUrl.Replace(url, @"${domain}"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* SO #22531861: simple progress spinner (SVG version) | |
* http://stackoverflow.com/questions/22531861/create-circular-round-process-bar-with-gradient | |
*/ | |
@keyframes rotate { | |
from { transform: rotate(0deg); } | |
to { transform: rotate(360deg); } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* SO #22531861: simple progress spinner (SVG version) | |
* http://stackoverflow.com/questions/22531861/create-circular-round-process-bar-with-gradient | |
*/ | |
@keyframes rotate { | |
from { transform: rotate(0deg); } | |
to { transform: rotate(360deg); } | |
} |