Skip to content

Instantly share code, notes, and snippets.

townivan

Block or report user

Report or block townivan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@townivan
townivan / css.css
Created Oct 5, 2016
html5 validation for Safari
View css.css
/* .invalid class prevents CSS from automatically applying */
.invalid input:required:invalid {
background: #BE4C54;
}
.invalid textarea:required:invalid {
background: #BE4C54;
}
.invalid select:required:invalid {
background: #BE4C54;
}
View inline-svg-scale
.img-svg { width:100%; height: auto; }
<img class="img-svg" src="box.svg" />
@townivan
townivan / .gitignore
Created Sep 5, 2016
.gitignore for vscode
View .gitignore
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
View scrollTo.js
// source: https://jonsuh.com/blog/better-scroll-to-anchor-links/
$(".anchorLink").click(function(e){
e.preventDefault();
var this_offset = $(this).offset();
var that_id = $(this).attr("href");
var that_offset = $(that_id).offset();
var offset_diff = Math.abs(that_offset.top - this_offset.top);
@townivan
townivan / matchHeight.js
Created Feb 5, 2016
Match heights with jQuery (because bootstrap won't)
View matchHeight.js
function getWindowWidth2() {
return window.innerWidth || document.body.clientWidth;
}
$(window).resize(function(){
myMatchHeight('.sameHeight1'); // first group of things I want the same height
myMatchHeight('.sameHeight2'); // second group of things I want the same height
});
$(window).load(function(){
myMatchHeight('.sameHeight1');
View raquo.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>raquo</title>
<style type="text/css">
a:link{text-decoration:none;}
a:hover, a:active{text-decoration:underline;}
.raquoSpan{
font-family:Arial, Helvetica, sans-serif;
@townivan
townivan / index.html
Last active Jun 29, 2016
bootstrap boilerplate 3.6
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Bootstrap 101 Template</title>
<link rel="shortcut icon" href=""><!-- removes error in console if you don't have a favicon -->
@townivan
townivan / calc.html
Last active Dec 11, 2015
JS load external JSON into localstorage
View calc.html
<!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');
View youtube embed and link
View onePageAspNet.aspx
<%@ 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)
{
You can’t perform that action at this time.