This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use Digest::SHA qw(hmac_sha256); | |
| use Furl; | |
| use MIME::Base64; | |
| use Time::Piece; | |
| use URI; | |
| use URI::Escape; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| use strict; | |
| use DBI; | |
| use Getopt::Long; | |
| use constant { | |
| OK => 0, | |
| WARNING => 1, | |
| CRITICAL => 2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ( window.addEventListener ) { | |
| var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65"; | |
| window.addEventListener("keydown", function(e){ | |
| kkeys.push( e.keyCode ); | |
| if ( kkeys.toString().indexOf( konami ) >= 0 ) | |
| window.location = "http://ejohn.org/apps/hero/"; | |
| }, true); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // document listener | |
| golgo.event = { | |
| listener: {}, | |
| __listener: {}, | |
| callback: function(type) { | |
| return function(e) { | |
| var listener = golgo.event.listener[type]; | |
| if (listener) { | |
| for (var i=0,len=listener.length; i<len; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // original code | |
| // John Resig - http://ejohn.org/ - MIT Licensed | |
| (function(){ | |
| var cache = {}; | |
| window.$T = function tmpl(str, data){ | |
| // Figure out if we're getting a template, or if we need to | |
| // load the template - and be sure to cache the result. | |
| var fn = !/\W/.test(str) ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| var ta = new ToggleAction({ | |
| on: function(obj) { | |
| setClass(obj, "on"); | |
| } | |
| off: function(obj) { | |
| removeClass(obj); | |
| } | |
| }); | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| var ex = new ExclusiveAction({ | |
| target: { | |
| b1: $("button1"), | |
| b2: $("button2"), | |
| b3: $("button3"), | |
| b4: $("button4") | |
| }, | |
| activeAction: function(obj) { | |
| // for selected obj |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // require: $(), bindListener() | |
| var Tab = function() { | |
| this.initialize.apply(this, arguments); | |
| } | |
| Tab.prototype = { | |
| prefix: "tab_", | |
| initialize: function(opt) { | |
| this.active = opt.active || 'active'; | |
| this.inactive = opt.inactive || 'inactive'; | |
| this.tab = opt.tab; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(){ | |
| var links = document.getElementsByTagName("a"); | |
| for (var i=0,len=links.length; i<len; i++) { | |
| try { | |
| var link = decodeURIComponent(links[i].getAttribute('href')); | |
| } catch(e) { | |
| var link = links[i].getAttribute('href'); | |
| } | |
| var urls = /^.+(http:\/\/\S+)$/.exec(link) || new Array(); | |
| if (urls[1]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Class = { | |
| create: function(base) { | |
| var fn = function() { | |
| this.initialize.apply(this, arguments); | |
| }; | |
| // inheritance | |
| if (base) | |
| fn.prototype = new base; | |
| if (!fn.prototype.initialize) | |
| fn.prototype = function(){}; |