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 / forfiles.bat
Created February 29, 2012 15:21
scan for files larger than given size on a windows drive
forfiles /P C:\path\to\files /M *.* /S /D +"01/01/2012" /C "cmd /c if @fsize gtr 200200200 echo @path @fsize @fdate @ftime"
@emjayess
emjayess / spoken-reminder.crontab
Created February 14, 2012 14:24
"are you working on your most important item?"
MacBook-Pro:~ emjayess$ crontab -l
42 08-18 * * 1-6 osascript -e "beep 5"; say -v Victoria -r 200 are you working on your most important item?
// see also: multiple ways to make a mac go 'beep'...
// http://stackoverflow.com/questions/3127977/how-to-make-the-hardware-beep-sound-in-mac-os-x-10-6
@emjayess
emjayess / gist:1284774
Created October 13, 2011 16:52
anonymous function using arguments with parent fn's variables
public function parentFn($argVar) {
$decVar = 0.00;
$callback = function ($anonVar) use ($argVar, &$decVar) {
$result += ($decVar * $anonVar) * ($argVar);
};
return round($result, 2);
}
@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' => '________@gmail.com', // or 'user.name@apps-domain.tld'
@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: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 / 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 / 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>
<!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>
<!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>