Skip to content

Instantly share code, notes, and snippets.

View aarongustafson's full-sized avatar
👋
he/him/his

Aaron Gustafson aarongustafson

👋
he/him/his
View GitHub Profile
<?php
function example()
{
$a = $b = 0;
}
?>
<div id="container">
<b class="rtop">
<b class="r1"></b> <b class="r2"></b>
<b class="r3"></b> <b class="r4"></b>
</b>
<!--content goes here -->
<b class="rbottom">
<b class="r4"></b> <b class="r3"></b>
<b class="r2"></b> <b class="r1"></b>
</b>
<<input name="company" /> id="company" maxlength="255" />
function createElementWithName( type, name ){
var element;
// First try the IE way; if this fails then use the standard way
if( document.all ){
element =
document.createElement( '< '+type+' name="'+name+'" />' );
}else{
element = document.createElement( type );
element.setAttribute( 'name', name );
}
<!ENTITY % Boolean
"(true | false)"
>
...
<!-- attributes for Dojo Toolkit
showButtons display buttons (boolean)
intermediateChanges display intermediate steps (boolean)
-->
<!ENTITY % dojo-attrs
"showButtons %Boolean #IMPLIED
// create a Squirrel instance
var $S = new Squirrel( 'scale-song' );
// write a value to the cache
$S.write( 'doe', 'ray' );
// read it back
$S.read( 'doe' ); // 'ray'
// write a value to a sub-cache
$S.write( 'song', 'doe', 'a dear, a female dear' );
@aarongustafson
aarongustafson / TinyMCE-config-HTML5.js
Created August 26, 2010 12:57
Working on a TinyMCE config that supports HTML5
// General
button_tile_map : true,
editor_selector : 'lg_mceEditor',
mode:'textareas',
theme : 'advanced',
// Cleanup/Output
apply_source_formatting : true,
convert_fonts_to_spans : true,
convert_newlines_to_brs : false,
@aarongustafson
aarongustafson / ensure-design-loads.js
Created September 8, 2010 20:25
Makes sure the layout is loaded (Webkit sometimes loses the design when the back button is used to return to a URL using a hash and slash anchor structure)
// make sure a user hitting the back button doesn't kill the layout
if ( window.addEventListener )
{
window.addEventListener('pageshow',function(e){
if (e.persisted)
{
setTimeout(function(){
window.scrollTo(window.scrollX,window.scrollY+1);
},10);
}
function adjustViewport( property, value )
{
var
$viewport = $('meta[name=viewport]'),
currently = $viewport.attr('content'),
o_props = currently.split(/\s,\s?/),
n_props = [],
i = o_props.length,
set = false;
while ( i-- )
function getIERotationMatrix( degrees )
{
var radians = degrees * ( Math.PI * 2 / 360 );
console.log( 'progid:DXImageTransform.Microsoft.Matrix( M11=' +
Math.cos( radians ) + ', M12=' + (0-Math.sin( radians )) +
', M21=' + Math.sin( radians ) + ', M22=' + Math.cos( radians ) +
', SizingMethod="auto expand" )' );
}