Skip to content

Instantly share code, notes, and snippets.

View saw's full-sized avatar

Stephen Woods saw

View GitHub Profile
@saw
saw / mm_
Created June 19, 2014 20:57
Remember this chestnut?
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
Chrome/30.0.1599.101 Safari/537.36 - [SA D 67101477@N00] - [FC 1] - 127.0.0.1
[c7e4fd67] debug: [opt-in] user is opted in to [photo,photostream,photobook]
[c7e4fd67] debug: [API] flickr.people.getInfo [params] {"user_id":"67101477@N00","datecreate":1,"extras":"icon_urls"}
[c7e4fd67] debug: [API] flickr.people.getInfo [timing] 261.826261 ms
[c7e4fd67] debug: [site auth] [67101477@N00] protohiro is signed in.
[ERROR] - [c7e4fd67] [app error handler] [TypeError: undefined is not a function] TypeError: undefined is not a function
at null.<anonymous> (/Users/saw/Code/flickr/hermes/lib/flickr-server-view.js:119:12)
at /Users/saw/Code/flickr/hermes/node_modules/yui/promise/promise.js:331:33
at Object._onImmediate (/Users/saw/Code/flickr/hermes/node_modules/yui/timers/timers.js:37:17)
at processImmediate [as _immediateCallback] (timers.js:330:15)
new Date.getTime();
@saw
saw / gist:3745816
Created September 18, 2012 20:52
Rendering mustache on server with mustache.php & client with handlebars
Data:
{
foo:true,
bar: "baz"
}
{{#foo}}
<h1>{{bar}}</h1>
{{/foo}}
@saw
saw / gist:2401551
Created April 16, 2012 21:14
My new commenting style...
;('my new commenting style')
sudo java -jar /usr/local/jars/yuicompressor-flickr-2.4.3.jar -o '.source.css$:-min.css' /var/www/html/stage-svn.flickr.com/css/*.source.css
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:20)
Caused by: java.lang.StackOverflowError
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)
at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
YModules["myshortcutmenus"] = {
init:function(api){
//store the api
this.api = api;
this.Y = api.getService('yui');
},
//called when the view is ready in the dom
onviewload:function(v){
var v = new RegExp();
v.compile("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");
if (!v.test(url)) {
return false;
}
return true;
var b=[],c=1;function d(a){var e=[],f=0;a&&b.push(a.join("\t"));for(a=0;a<10;a++)e.push(++f*c);c++<11&&d(e)}d();alert(b.join("\n"));
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Multiplication Tables</title>
</head>
<body>
<h1>{{message}}</h1>
<div id="table">