Skip to content

Instantly share code, notes, and snippets.

View mjuhl's full-sized avatar

Matt Juhl mjuhl

View GitHub Profile
@mjuhl
mjuhl / Radio Options markup.html
Created January 26, 2011 19:06
The radio group needs a label, and each individual option needs to be labeled also. Is this the right way to do it?
<fieldset id="colorSelector">
<label for="color">Color</label>
<label><input name="color" type="radio" value="red">Red</label>
<label><input name="color" type="radio" value="green">Green</label>
</fieldset>
@mjuhl
mjuhl / getFlashMajorVersion.js
Created April 11, 2011 18:18
Function to return the major version of Flash Player installed
function getFlashMajorVersion () {
var flashVersion = '0,0,0';
// ie
try {
try {
// avoid fp6 minor version lookup issues
// see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
try {
axo.AllowScriptAccess = 'always';
@mjuhl
mjuhl / readable.js
Last active September 27, 2015 04:38
Readable bookmarklet
javascript:(function(){_readableOptions={'text_font':'Source Sans Pro, Avenir Next','text_font_monospace':'source code pro, inconsolata','text_font_header':'source sans pro, Avenir Next Condensed','text_size':'18px','text_line_height':'1.618','box_width':'30em','color_text':'#444','color_background':'#F9F9F9','color_links':'#1F7BB6','text_align':'normal','base':'blueprint','custom_css':'h1,h2,h3,h4,h5,h6 { font-weight: 700; font-family: open sans condensed, avenir next condensed; open sans condensed; color: #333; text-transform: uppercase; }code, pre { background: #eee; color: #626262; font-size: 11.125px; }pre {overflow: auto; padding: 11.125px; }::selection { background: #edefef; }blockquote {font-style: normal;border-left: 6px solid #f0f0f0;color: #777;font-weight: 300;}'};if(document.getElementsByTagName('body').length>0);else{return;}if(window.$readable){if(window.$readable.bookmarkletTimer){return;}}else{window.$readable={};}window.$readable.bookmarkletTimer=true;window.$readable.options=_readableOpti
@mjuhl
mjuhl / fieldset-issue-1.html
Created October 3, 2011 17:57
Firefox fieldset element rendering bug #1
<!doctype html>
<html>
<head>
<title>Fieldset Issues</title>
<style>
body {
font: 1em/1.5 'helvetica neue', sans-serif;
}
@mjuhl
mjuhl / fieldset-issue-2.html
Created October 3, 2011 17:57
Firefox fieldset element rendering bug #2
<!doctype html>
<html>
<head>
<title>Fieldset Issue 2</title>
<style>
body {
font-family: 'helvetica neue', arial, sans-serif;
}
@mjuhl
mjuhl / progress.php
Created October 12, 2011 18:19
PHP Output Buffering/JavaScript/CSS Transition Progress Bar Experiment
<?php
/* For AJAX, if frustrated, try the following (see http://www.php.net/manual/en/function.flush.php#91556):
@apache_setenv('no-gzip', 1);
@ini_set('zlib.output_compression', 0);
*/
ob_start();
set_time_limit(0); // for scripts that run really long
function force_flush ($add_whitespace = TRUE) {
@mjuhl
mjuhl / longprocess_trick.php
Created October 12, 2011 19:25
Long running script that doesn't care if the user presses stop
<?php
// Ignore user aborts and allow the script
// to run forever
ignore_user_abort(true);
ob_start();// if notifying the user
set_time_limit(0);
@mjuhl
mjuhl / starter.html
Created August 23, 2012 19:32
Because I do this too often...
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>REPLACE</title>
<link rel="stylesheet" href="REPLACE.css">
</head>
<body>
<script type="text/javascript" src="REPLACE"></script>
@mjuhl
mjuhl / starter.css
Created August 23, 2012 19:54
Because I do this too often...
*, *:after, *:before {
margin: 0;
padding: 0;
position: relative;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html { font-size: 100% /* everything will be based on the default text size */ }
@mjuhl
mjuhl / flashDetect.js
Created September 7, 2012 16:33
A function for detecting flash version
function getFlashVersion (majorVersion /* = true */) {
if (majorVersion !== false) {
var majorVersion = true;
}
// detect flash version
var flashVersion = '0,0,0';
// ie
try {
try {
// avoid fp6 minor version lookup issues