Skip to content

Instantly share code, notes, and snippets.

View stoyanvi's full-sized avatar

Stoyan Ivanov stoyanvi

  • Sofia, Bulgaria
View GitHub Profile
/*
Author: Joshua P. Mervine <[email protected]> [github.com/jmervine]
See: http://jsfiddle.net/jmervine/dqA9r/5/
Use:
<script src="http://cdn.mervine.net/FormattedDate.js" />
<script src="http://cdn.mervine.net/FormattedDate.min.js" />
angular.module('foo', [])
.config(function($provide) {
$provide.decorator('$rootScope', function ($delegate) {
// Shim needed for browsers I don't care about
var proto = Object.getPrototypeOf($delegate);
proto.$bar = function() {
// Do something
};
// How I would approach a fluid grid:
//
// [1] Let the name reflect the % width,
// eliminating "1 of 12" guesswork.
//
// [2] Also, put 10px of padding to either
// side, to stack and make a 20px gutter.
//
// [3] Make the box-sizing = border-box, so that
// 50% + 20px total side padding = 50%, etc.
@stoyanvi
stoyanvi / max_width_email_template.html
Last active December 11, 2017 15:15
HTML Email Template: max-width hack for MS Outlook
<!--[if (gte mso 9)|(IE)]>
<center>
<table>
<tr>
<td width="600">
<![endif]-->
<div style="max-width: 600px; margin: 0 auto;">
<p>This text will be centered and constrained to 600 pixels even on Outlook which does not support max-width CSS</p>
</div>
<!--[if mso]>