Skip to content

Instantly share code, notes, and snippets.

View joesteinkamp's full-sized avatar

Joe Steinkamp joesteinkamp

View GitHub Profile
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/iconsets/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<polymer-element name="my-element">
<template>
<style>
@joesteinkamp
joesteinkamp / Default (Windows).json
Last active October 9, 2015 02:48
My Sublime Text 2 Configuration
[
{ "keys": ["ctrl+b"], "command": "toggle_side_bar" },
{ "keys": ["f7"], "command": "build" }
]
@joesteinkamp
joesteinkamp / script.js
Created August 19, 2012 17:15
iOS Bookmarklet: Open with Google Chrome. Open a link in Mobile Safari in Google Chrome.
javascript:location.href=%22googlechrome%22+location.href.substring(4);
@joesteinkamp
joesteinkamp / script.js
Created August 19, 2012 17:14
iOS Bookmarklet: Open with Textastic. Great for very webpage source.
javascript:location.href=%22textastic%22+location.href.replace(/^https?/, '');
@joesteinkamp
joesteinkamp / script.js
Created August 19, 2012 17:13
Load Embedded CSS Styles Based on User Agent
// Add Style Tag to Head
var head = document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.id = 'newStyle';
head.appendChild(style);
var styles;
// Check if iPhone or iPod
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
@joesteinkamp
joesteinkamp / script.js
Created August 19, 2012 17:12
Scroll Down to Hide Address Bar in Mobile Safari
/iPhone/.test(navigator.userAgent) && !location.hash && setTimeout(function () {
if (!pageYOffset) window.scrollTo(0, 1);
}, 1000);​
@joesteinkamp
joesteinkamp / script.js
Created August 19, 2012 17:08
Load External CSS Styles Based on User Agent. Use for mobile CSS loading (saves loading time).
// Check if iPhone or iPod
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
var cssPath = "http://path.to/iPhone.css";
}
// Check if Android
if ((navigator.userAgent.match(/Android/i))) {
var cssPath = "http://path.to/Android.css";
}
@joesteinkamp
joesteinkamp / style.css
Created August 19, 2012 17:01
Linear Gradients: Cross Browser Syntax including Mobile
body {
background: #f06;
background: -webkit-gradient(linear, left top, left bottom, from(#f06), to(#ff0)); /* Saf4+, Chrome, iOS 3.2-4.3, Android 2.1-3 */
background: -webkit-linear-gradient(top, #f06, #ff0); /* Chrome 10+, Saf5.1+, iOS 5+, Android 4+ */
background: -moz-linear-gradient(top, #f06, #ff0); /* FF3.6+ */
background: -o-linear-gradient(top, #f06, #ff0); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #f06, #ff0); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f06', endColorstr='#ff0', GradientType=0); /* IE 5.5–7 */
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#f06', endColorstr='#ff0', GradientType=0)"; /* IE 8–9 */
background: linear-gradient(to bottom, #f06, #ff0); /* W3C */
@joesteinkamp
joesteinkamp / index.html
Created August 19, 2012 16:58
Border Radius: Cross Browser Syntax including Mobile with comments explaining CSS support.
<div id="example">
Hello!
</div>​