Skip to content

Instantly share code, notes, and snippets.

View marksy's full-sized avatar
💭
👋

Mark Chambers marksy

💭
👋
View GitHub Profile
@marksy
marksy / ColorHighlighter.sublime-settings
Last active July 4, 2018 03:37
SyncSettings for Sublime
{
"search_colors_in":
{
"all_content":
{
"color_highlighters":
{
"color_scheme":
{
"enabled": true,
@marksy
marksy / addClassiOS
Last active August 29, 2015 13:57
Adds class to HTML tag if userAgent is ipad/iphone/ipod
var iOS = (navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false);
console.log('Is the userAgent iOS: ' + iOS);
if (iOS) {
console.log('The userAgent is probably iOS');
$('html').addClass('mobile-safari');
} else {
console.log('This userAgent aint no iOS');
}
@marksy
marksy / devtools
Last active December 31, 2015 05:39
styling for devTools
#dev-tools {
background: rgba(51,53,44,.95);
border-bottom: 1px solid rgba(255,255,255,.2);
color: rgba(228,223,112,1);
display: none;
font-family: 'Courier', monospace;
font-size: 1.4em;
padding: 12px;
position: fixed;
top: 0;
@marksy
marksy / devTools
Last active December 31, 2015 05:39
devTools shows viewport dimensions on screen for rwd
var viewportX = $(window).width();
var viewportY = $(window).height();
var docY = $(document).height();
$('body').append('<div id=\"dev-tools\"></div>');
$('#dev-tools').css('display', 'block').html('<span class="alt-color">width:</span>' + viewportX + 'px <span class="alt-color">height:</span>' + viewportY + 'px <span class="alt-color">docHeight:</span> ' + docY + 'px');
$(window).resize(function () {
var viewportX = $(window).width();