Skip to content

Instantly share code, notes, and snippets.

@seanwalsh
seanwalsh / Twitter Card Markup
Last active August 29, 2015 14:03
Twitter Card Markup Reference
/*
Twitter Card Markup Reference
https://dev.twitter.com/docs/cards/markup-reference
Title: max 70 characters
Description: maximum 200 characters
Images: Keep images under 1MB
URL: not in documentation but in examples
*/
@seanwalsh
seanwalsh / Change Title Tag OnBlur
Last active August 29, 2015 14:03
Change the title tag when the user goes to another window/tab.
window.onblur = function () { document.title = 'Your new HTML Title tag'; }
window.onfocus = function () { document.title = 'The default title tag'; }
@seanwalsh
seanwalsh / eula.css
Last active August 29, 2015 14:04
CSS to quickly format a EULA or any legal document. Most basic elements will work but there are a few extra things needed.
body { margin: 15px;}
.bold { font-weight: bold; }
.caps { text-transform: uppercase; }
.center { text-align: center; }
.circle { list-style: circle; }
.smcaps { font-variant: small-caps; }
.unstyled { list-style: none; }
@seanwalsh
seanwalsh / Change Title Tag
Created July 25, 2014 13:12
A little bit of Javascript to change the title of a page after loosing focus. For example, switching to another window or tab.
// Change Title Tag on Blur
var titleCurrent = document.title;
var titleList = [
"Hey, over here.",
"Don't you forget about me",
"Please come back"
];
var titleIndex = "";
function titleRandom(){
@seanwalsh
seanwalsh / Android Browser Test
Last active August 29, 2015 14:04
Testing for Android less then 4.3
// Test for Android < 4.4
var nua = navigator.userAgent;
var nuaStart = navigator.userAgent.indexOf("Android ");
var nauVersion = navigator.userAgent.substr(nuaStart+8,3)
if (nauVersion < 4.4 ) {
document.documentElement.className += ' droid'; }
@seanwalsh
seanwalsh / highlight.scss
Created July 29, 2014 20:00
Wired style underlined anchor with a little flare.
// Variables
$a-highlight: yellow;
// Sass
.highlight-a a {
background-color: inherit;
border-bottom: 1px solid $a-highlight;
box-shadow: inset 0 -4px 0 $a-highlight;
color: inherit;
text-decoration: none;
@seanwalsh
seanwalsh / playvideo.html
Created July 30, 2014 20:03
HTML & simple jQuery to display and autoplay a YouTube video after a button/link has been clicked. There is more magic that displays the content but that is for another gist. This just sets the URL of the iframe and starts the video.
<figure class="video">
<iframe id="video-player" data-videoid="du4Y4KtGXBg" src="" frameborder="0" allowfullscreen></iframe>
</figure>
@seanwalsh
seanwalsh / clearfix.scss
Created August 7, 2014 13:04
Clearfix mixin
@mixin clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
ul > li:after {
content: "|";
margin-left: 10px; }
ul > li:last-child:after {
content: ""; }
@seanwalsh
seanwalsh / customFunction.txt
Created December 29, 2014 00:43
FileMaker custom function documentation.
/*
customFunction 2006 Sean Walsh
Developed by: Developer Name
Format:
customFunction ( field )
Parameters:
field - any related field, repeating field, or set of non-repeating fields; or an expression that returns a field, repeating field, or set of non-repeating fields.