Skip to content

Instantly share code, notes, and snippets.

View emjayess's full-sized avatar
💭
🪞 mirroring repos from gitlab

Matthew J. Sorenson emjayess

💭
🪞 mirroring repos from gitlab
View GitHub Profile
@emjayess
emjayess / D7-hook_js_alter-example.php
Created March 25, 2011 19:13
include a more up-to-date version of jquery than what ships with Drupal 7 core...
function hook_js_alter(&$js) {
$js['misc/jquery.js']['data'] = drupal_get_path('module', 'jquery_update') . '/jquery.js';
}
@emjayess
emjayess / qunit-boilerplate-markup.html
Created May 11, 2011 19:13
QUnit boilerplate markup
<!DOCTYPE html>
<html>
<head>
<title>javascript unit tests...</title>
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css"/>
</head>
<body>
<h1 id="qunit-header">QUnit Sample</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Conforming XHTML 1.0 Transitional Template</title>
</head>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Conforming XHTML 1.0 Strict Template</title>
</head>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Conforming XHTML 1.0 Frameset Template with accessibility</title>
</head>
@emjayess
emjayess / xhtml-1.1-template.html
Created May 27, 2011 18:25
Conforming XHTML 1.1 Template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Conforming XHTML 1.1 Template</title>
</head>
@emjayess
emjayess / valid_function_args.example.js
Created August 27, 2011 15:44
advice: existence and type check for function arguments
function gimmeh_funcs(myfunc, callback) {
if (myfunc && typeof myfunc === 'function') {
/* myfunc is safe to use */
}
if (callback && typeof callback === "function") {
/* callback is safe to use */
}
}
@emjayess
emjayess / gist:1176634
Created August 28, 2011 12:55
Definition of Open
repo init -u git://android.git.kernel.org/platform/manifest.git ; repo sync ; make
@emjayess
emjayess / unlayout.js
Created August 28, 2011 14:21
scripted layout techniques
/**
* @file: unlayout.js
*/
jQuery(function(){
(function($,w) {
var unlayout = {}
, $w = $(w)
, $pagehdr = $('#page-header')
, $sidebar = $('#sidebar')
, shrinkage = 12; // very arbitrary amount of default shrinkage
@emjayess
emjayess / gist:1284740
Created October 13, 2011 16:40
programmatic access to gmail/google apps mailbox using zend framework php
// IMAP access must first be enabled on the account you want to check
function mail_googleapps()
{
try {
return new Zend_Mail_Storage_Imap(
array(
'ssl' => 'SSL',
'host' => 'imap.gmail.com',
'port' => '993',
'user' => '[email protected]', // or '[email protected]'