Skip to content

Instantly share code, notes, and snippets.

View clintecker's full-sized avatar
🎯
Focusing

Clint Ecker clintecker

🎯
Focusing
View GitHub Profile
<?
$GLOBALS['published_dir'] = getenv('ARS_PUBLISHED_DIR');
if(!$GLOBALS['published_dir']){
$GLOBALS['published_dir'] = '/var/www/published/';
}
$GLOBALS['app_engine_dir'] = getenv('ARS_APP_ENGINE_DIR');
if(!$GLOBALS['app_engine_dir']){
$GLOBALS['app_engine_dir'] = '/var/www/published/app/';
}
require_once($GLOBALS['published_dir'] . 'includes_c/classes.inc.php');
cpanm (App::cpanminus) 1.1008 on perl 5.010000 built for darwin-thread-multi-2level
Work directory is /Users/clintecker/.cpanm/work/1304377199.72165
You have make /usr/bin/make
You have LWP 5.837
You have /usr/bin/tar: bsdtar 2.6.2 - libarchive 2.6.2
You have /usr/bin/unzip
Searching Data::Dumper on cpanmetadb ...
--> Working on Data::Dumper
Fetching http://search.cpan.org/CPAN/authors/id/S/SM/SMUELLER/Data-Dumper-2.128.tar.gz
-> OK
$.fn.extend
myplugin: (options) ->
self = $.fn.myplugin
opts = $.extend self.default_options, options
$(this).each (i, el) ->
self.init el, opts
self.log el if opts.log
$.extend $.fn.myplugin,
default_options:
@clintecker
clintecker / gist:768353
Created January 6, 2011 19:01
da-storefront-product.jsz
/*
** Copyright (C) 2011 Apple Inc.
** All rights reserved.
*/
function ItsDaScreenshotsController() {}
ItsDaScreenshotsController.prototype.domReady = function domReady() {
this.bindToElements("#screenshots")
};
iTSKit.registerController(ItsDaScreenshotsController);
@clintecker
clintecker / homepage.html
Created November 8, 2010 17:18
yet another proof
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
@clintecker
clintecker / new-scroller-demo.html
Created November 8, 2010 16:57
A proof of concept
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
x = navigator.userAgent
y = new RegExp('/safari/')
z = new RegExp('/firefox/')
switch x
when x.match(y) then safari()
when x.match(z) then firefox()
else usuck()
<script type="text/javascript" charset="utf-8">
if(navigator.geolocation && navigator.vendor.indexOf('Apple') !== -1) {
// Safari 5 added geolocation, so any Apple browser including it
// would have Reader. Yeah I know this also catches MobSaf too.
var meanies = document.createElement('p');
meanies.style['position'] = 'absolute';
meanies.style['left'] = '-10000px';
meanies.innerHTML = 'I can make you see things in Safari Reader :) <img src="http://clintecker.com/thumbsup.jpg" /> <object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/GEXn_8FG75Q&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/GEXn_8FG75Q&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>';
var article = document.getElementById('article');
article.inser
ars.interior.update_hidden_comment = function(e){
var hidden = $('#hiddencomment'),
comment = $('#comment-form-textarea');
hidden.text(comment.val());
if(hidden.height() > 224){
comment.css('height', hidden.height() + 'px');
} else {
comment.css('height', '224px');
}
};
proc stock symbol {
set html [unescape_html_entities [wget http://www.google.com/finance?q=$symbol]];
set cn [html [strip_html [lindex [regexp -all -inline {<h1>(.*?)</h1>} $html] 1]]];
set curr [html [strip_html [lindex [regexp -all -inline {<span class="pr".*?>(.*?)<} $html] 1]]];
set chr [regexp -all -inline {<span class="ch[rg]".*?>(.*?)<} $html];
if {[lindex $chr 1] < 0} {set col red} else {set col green};
. "[bold]$curr[bold]: [color $col on white][html [strip_html [lindex $chr 1]]] [html [strip_html [lindex $chr 3]]][color] [color blue on white]$cn[color]"}