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
| <!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> |
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
| <!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> |
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 hook_js_alter(&$js) { | |
| $js['misc/jquery.js']['data'] = drupal_get_path('module', 'jquery_update') . '/jquery.js'; | |
| } |
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 | |
| # modes | |
| use strict; | |
| use warnings; | |
| # modules | |
| use Text::CSV; | |
| my $csv = 'DATA.TXT'; |
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
| <cfscript> | |
| writeoutput( | |
| stache.render( | |
| $.getTMPL(mustache_path & "navigation.mustache"), | |
| $.getJSON(fixtures_path & "navigation.json") | |
| ) | |
| ); | |
| </cfscript> |
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
| // replace 'foo' with the name of the plugin, etc | |
| (function($){ | |
| $.fn.foo = function(opts) { | |
| var settings = $.extend({}, $.fn.foo.defaults, opts); | |
| return this.each(function() { | |
| var $this = $(this); | |
| // plugin code here... | |
| }); | |
| }; |
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
| /*! | |
| * JavaScript whatevCache - v0.2pre - 12/30/2010 | |
| * http://benalman.com/ | |
| * | |
| * Copyright (c) 2010 "Cowboy" Ben Alman | |
| * Dual licensed under the MIT and GPL licenses. | |
| * http://benalman.com/about/license/ | |
| */ | |
| // whatevCache.set( key, value [, ttl ] ); |
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
| <cfscript> | |
| // require https://github.com/pmcelhaney/Mustache.cfc | |
| mustache = createobject('component','cfc/mustache');//dump(mustache); | |
| //view template: | |
| hello_templ = '<h1>Hello, {{thing}}</h1>'; | |
| //model object: | |
| hello_model = { | |
| thing = 'Mustache' |
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
| // the agility of javascript's ternary operation... | |
| // lots of folks don't seem aware of the subsequent assignments available | |
| function ternary(a,b) { | |
| var c,d,tis=''; | |
| c = (d = a==b) ? tis='tis true' : tis='tis false'; | |
| return [c,d,tis]; | |
| } | |
| console.log(ternary(true,true)); | |
| console.log(ternary(true,false)); |
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
| // Cross-browser object.watch and object.unwatch | |
| // object.watch | |
| if (!Object.prototype.watch) { | |
| Object.prototype.watch = function (prop, handler) { | |
| var oldval = this[prop], newval = oldval, | |
| getter = function () { | |
| return newval; | |
| }, | |
| setter = function (val) { |