Skip to content

Instantly share code, notes, and snippets.

@townivan
townivan / calc.html
Last active December 11, 2015 15:39
JS load external JSON into localstorage
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Calculator</title>
<style>body{display:none;}</style>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script>
function loadMyJson() {
return $.getJSON('_config.json');
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Data" %>
<%@ Page Language="C#" Debug="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="C#" runat="server">
void Page_Error(Object source, EventArgs e)
{
@townivan
townivan / gist:952b0385b59c559846ff
Created September 30, 2014 17:13
img padding not working in Outlook 2007
issue: padding and margin on the img tag don't work in Outlook 2007
use the old hspace="8" on the image (which will add the spacing that you want on outlook) then add margin-left="0px" to trim off the extra on the side that you don't want. Unfortunately this will still have the extra spacing on the side that you don't want for Outlook 2007 but the other email clients will be ok.
@townivan
townivan / gist:29815c04c31a04b94caf
Created September 23, 2014 18:52
Prevent superscripts from breaking line-height
sup, sub {
vertical-align: baseline;
position: relative;
top: -0.4em;
}
sub { top: 0.4em; }
/*
Source: http://css-tricks.com/snippets/css/prevent-superscripts-and-subscripts-from-affecting-line-height/
*/
@townivan
townivan / gist:22818255d0a99843bb08
Created July 29, 2014 13:02
Quick querystring with javascript example
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>jquery for querystring parsing</title>
</head>
<body>
<p>To try this out, add something like <pre>?fname=Joe&lname=Smith</pre> to the end of the URL for this page.</p>
@townivan
townivan / gist:aea53cd482cd053e41e4
Created July 25, 2014 15:16
yahoo mail won't center your table? Try this.
<table style="table-layout: fixed; margin: 0 auto;" align="center">
@townivan
townivan / gist:03f956f0d2e4ebb77f6e
Created July 16, 2014 18:02
my quick html boilerplate
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css">
@townivan
townivan / gist:d24c9477723e1cb308fa
Created July 16, 2014 17:27
Use localstorage instead of cookies
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
@townivan
townivan / gist:f8346fcc432db32518a6
Created July 3, 2014 22:38
jquerymobile add a control dynamically
<!DOCTYPE html>
<html>
<head>
<title>Load Control Dynamically</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.css" />
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.js"></script>