Skip to content

Instantly share code, notes, and snippets.

View craigerskine's full-sized avatar
🎮
UX Designer/Developer

Craig @qrayg craigerskine

🎮
UX Designer/Developer
View GitHub Profile
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>CSS: Vertical Centering</title>
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600" rel="stylesheet" />
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" />
<style>
@craigerskine
craigerskine / event-tracking.js
Created August 16, 2010 20:01
JS Analytics Event Tracking for Downloads/Files
document.onclick = function(event) {
event = event || window.event;
var target = event.target || event.srcElement,
targetElement = target.tagName.toLowerCase();
if (targetElement == "a") {
var href = target.getAttribute("href"),
urlHost = document.domain.replace(/^www\./i,"");
var urlPattern = "^(?:https?:)?\/\/(?:(?:www)\.)?" + urlHost + "\/?";
eventCheck(href,urlPattern);
.cf:before,.cf:after { content: " "; display: table; }
.cf:after { clear: both; }
.cf { zoom: 1; }
/* tablet landscape */
@media only screen and (max-width: 979px){
}
/* tablet portrait / mobile landscape */
@media only screen and (max-width: 767px){
}
@craigerskine
craigerskine / REGEX.md
Last active December 2, 2016 21:09
Simple email REGEX

^(/|http://|https://)
Start with / or http

^(http|https):\/\/((?!domain.com).)*$
This is for redirecting to EXTERNAL websites ONLY!!! Do not use this to redirect to pages or files within your own site. This field must start with http(s):// and NOT contain domain.com

^[\s\S]{0,200}$
MAX = 200 characters

^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}$

$(function(){
// table
var table_data = [
{
name: '<a href="#">Some name</a>',
id: '1'
}
]
$('#table-bootstrap').bootstrapTable({
data: table_data,
@craigerskine
craigerskine / ie-target-hacks.css
Created September 18, 2018 18:50
IE CSS Target Hacks
/* 6 */
* html .blah { property: value; }
.blah { _property: value; }
/* 7 */
*+html .blah { property: value; }
*:first-child+html .blah { property: value; }
/* 6 & 7 */
@media screen\9 { .blah { property: value; } }
@craigerskine
craigerskine / tailwind-vars.css
Created May 6, 2020 20:38
TailwindCSS v.0.7.4 with color variables
:root {
--color-black: #22292F;
--color-grey-darkest: #3D4852;
--color-grey-darker: #606F7B;
--color-grey-dark: #8795A1;
--color-grey: #B8C2CC;
--color-grey-light: #DAE1E7;
--color-grey-lighter: #F1F5F8;
--color-grey-lightest: #F8FAFC;
--color-white: #FFFFFF;