Other makeClass

var makeClass = function(prototypeObj,superClass) {
    var madeClass = function(o) {
        if (o!=false) this.initialize(o);
    };
    if (typeof superClass == 'function') {
        var superClassObj = new superClass(false);
        for(var method in superClassObj)
            prototypeObj[(prototypeObj[method])?'super_'+method:method] = superClassObj[method];
    };
    madeClass.prototype=prototypeObj;
    return madeClass;
};

Other objEval

var objEval = function(template,params,subFunc) {
    var subFunc = subFunc || function() {return ''};
    var match;var compiled = [];
    while (template.length > 0) {
        if (match = template.match(/(^|.|\r|\n)(#\{(.*?)\})/)) {
            compiled.push(template.slice(0, match.index));
            compiled.push(match[1] || '');
            var list = match[3].split(/\.|\[|\]\[|\]\.|\]/);
            if (!list[list.length-1]) list.pop();
            if (typeof params[list]=='function') {
                compiled.push(params[list](list[0]));
            }
            else if (!params[list]) {
                compiled.push(subFunc(list));
            }else if(typeof params[list]!='object'){
                compiled.push(params[list]);
            }
            template = template.slice(match.index + match[0].length);
        } else {
            compiled.push(template), template = '';
        }
    }
    return compiled.join("");
};
var html2el = function(html) {
    var div = document.createElement('div');
    div.innerHTML=html;
    return div.firstChild;
};
var obj2el = function(template,obj,subFunc) {
    return html2el(objEval(template,obj,subFunc))
};

Other Cairngorm代表

/** *******************************************************************
 * MySnippets
 * Free for use
 *
 * @author  Jonnie Spratley
 * @contact jonniespratley@gmail.com
 ******************************************************************* */
package
{
	import com.adobe.cairngorm.business.ServiceLocator;
	
	import flash.utils.ByteArray;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;

	/**
	 * The Business Delegate delegates all the responsibility for the
	 * business logic that must locate a service, and then invokes
	 * a method on the service.
	 *
	 */
	public class Delegate
	{
		private var responder:IResponder;
		private var service:Object;

		public function SnipprDelegate( responder:IResponder )
		{
			this.service = ServiceLocator.getInstance().getRemoteObject( "MyService" );
			this.responder = responder;
		}

		/************** ServiceCalls ********************/
		public function getData():void
		{
			var token:AsyncToken = service.getData();
				token.addResponder( responder );
		}		
	}
}

Other 用于snippetsEmu的TSQL片段

if !exists('loaded_snippet') || &cp
    finish
endif

Snippet $proc IF EXISTS (<CR>SELECT 1 FROM INFORMATION_SCHEMA.ROUTINES<CR>
            \WHERE ROUTINE_NAME = '<{"name"}>'<CR>
            \AND ROUTINE_SCHEMA = 'dbo'<CR>AND ROUTINE_TYPE = 'PROCEDURE'<CR><BS>)<CR>
            \BEGIN<CR>DROP PROCEDURE dbo.<{"name"}><CR>
            \PRINT 'Dropped dbo.<{"name"}>'<CR>
            \END<CR>GO<CR><CR>CREATE PROCEDURE dbo.<{"name"}> (<CR>
            \/*<CR>  Sample calls:<CR>
            \<BS><Tab>EXEC <{"name"}><CR><BS>*/<CR>)<CR>AS BEGIN<CR>
            \<Tab>SET NOCOUNT ON<CR><{}><CR>END<CR>GO<CR><CR>IF @@ERROR = 0<CR>
            \PRINT 'Created dbo.<{"name"}>'<CR><BS>GO<CR>

Snippet $func IF EXISTS (<CR>SELECT 1 FROM INFORMATION_SCHEMA.ROUTINES<CR>
            \WHERE ROUTINE_NAME = '<{"name"}>'<CR>
            \AND ROUTINE_SCHEMA = 'dbo'<CR>AND ROUTINE_TYPE = 'FUNCTION'<CR><BS>)<CR>
            \BEGIN<CR>DROP FUNCTION dbo.<{"name"}><CR>
            \PRINT 'Dropped dbo.<{"name"}>'<CR>
            \END<CR>GO<CR><CR>CREATE FUNCTION dbo.<{"name"}> (<CR>
            \/*<CR>  Sample calls:<CR>
            \<BS><Tab>SELECT dbo.<{"name"}>()<CR><BS>*/<CR>)<CR>
            \RETURNS <{"return_type"}><CR>AS BEGIN<CR>
            \<Tab><{}><CR>END<CR>GO<CR><CR>IF @@ERROR = 0<CR>
            \PRINT 'Created dbo.<{"name"}>'<CR><BS>GO<CR>

Snippet $view IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.VIEWS 
            \WHERE TABLE_NAME = '<{"name"}>') BEGIN<CR>
            \DROP VIEW dbo.<{"name"}><CR>
            \PRINT 'Dropped dbo.<{"name"}>'<CR>
            \END<CR>GO<CR><CR>CREATE VIEW dbo.<{"name"}><CR>AS<CR>
            \/* Sample calls:<CR>
            \<Tab>SELECT * FROM <{"name"}><CR><BS>*/<CR><{}><CR>GO<CR>
            \<CR>IF @@ERROR = 0<CR>
            \PRINT 'Created dbo.<{"name"}>'<CR><BS>GO<CR>

Snippet $table IF EXISTS (<CR>SELECT 1 FROM INFORMATION_SCHEMA.TABLES<CR>
            \WHERE TABLE_NAME = '<{"name"}>' 
            \AND TABLE_SCHEMA = 'dbo'<CR><BS>)<CR>BEGIN<CR>
            \DROP TABLE dbo.<{"name"}><CR>
            \PRINT 'Dropped dbo.<{"name"}>'<CR>
            \END<CR>GO<CR><CR>CREATE TABLE dbo.<{"name"}> (<CR>
            \<{}><CR>)<CR>GO<CR><CR>IF @@ERROR = 0<CR>
            \PRINT 'Created dbo.<{"name"}>'<CR><BS>GO<CR>

Snippet $sum SUM(<{"field"}>) AS <{"field"}>,<{}>

Snippet $vc varchar(<{"size"}>)<{}>

Snippet $c char(<{"size"}>)<{}>

Snippet $d decimal(<{"size"}>,<{"precision"}>)<{}>

Snippet $tv DECLARE @<{"name"}> table (<CR><{}><CR>)

Snippet $tt CREATE TABLE #<{"name"}> (<CR><{}><CR>)

Other 在谷歌搜索音频文件

-inurl:(htm|html|php) intitle:"index of" +"last modified" +"parent directory" +description +size +(wma|mp3) "BANDA/CANCIÓN"

Other 用Ruby编写一个文件

=begin
r - Open a file for reading. The file must exist.
w - Create an empty file for writing. If a file with the same name already exists its content is erased and the file is treated as a new empty file.
a - Append to a file. Writing operations append data at the end of the file. The file is created if it does not exist.
r+ - Open a file for update both reading and writing. The file must exist.
w+ - Create an empty file for both reading and writing. If a file with the same name already exists its content is erased and the file is treated as a new empty file.
a+ - Open a file for reading and appending. All writing operations are performed at the end of the file, protecting the previous content to be overwritten. You can reposition (fseek, rewind) the internal pointer to anywhere in the file for reading, but writing operations will move it back to the end of file. The file is created if it does not exist.
=end

File.open(local_filename, 'w') {|f| f.write(doc) }

Other 智能文本重新分析器ala jQuery(和cookie)

<script src="graphics/js/jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="graphics/js/jquery.cookie.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		// See which font size the user wants
		$(".text a").click(function() {
			switch ($(this).attr("class")) {
				case 'small'	: setFontSize(.8);	break;
				case 'large'	: setFontSize(1.6);	break;
				case 'default'	: setFontSize(1.2);	break;
			}
			return false;
		});

		// Set the font size and set a cookie
		function setFontSize(size) {
	        $("#wrap, input, textarea").animate({fontSize: size+"em"}, 500).fadeIn("slow");
				createCookie(size);
			}

			// Create and read coookies
			// Code functions by: Peter-Paul Koch
			// http://www.quirksmode.org/js/cookies.html
			function createCookie(value) {
				var date = new Date();
				date.setTime(date.getTime()+(30*24*60*60*1000));
				var expires = "; expires="+date.toGMTString();
				document.cookie = "font_size="+value+expires+"; path=/";
			}
		var font_size = $.cookie('font_size');
		   if (font_size == '0.8') {
		        $('#wrap').css("font-size",".8em");
			}
		   if (font_size == '1.6') {
		        $('#wrap').css("font-size","1.6em");
			}
		   if (font_size == '1.2') {
		        $('#wrap').css("font-size","1.2em");
			}
	});
</script>

Other EXTJS - 基本网格蓝图

/**
 * generate a grid, it so commonly used that i decided to make it easy to initiate
 */

var getNewGrid = function (id, store, columns) {
	
	var store = store || new Ext.data.JsonStore({
		    url: 'get-images.php',
		    root: 'elements',
		    fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]
		});

	var columns = columns || [
	        {id: 'name', header: 'Name', sortable: true, dataIndex: 'name'},
	        {header: 'Modified', width: 120, sortable: true, dataIndex: 'modified'},
	        {header: 'Type', width: 120, sortable: true, dataIndex: 'type', readOnly: false},
	        {header: 'Size', width: 120, sortable: true, dataIndex: 'size', align: 'right'}
	    ]    	
	
	return  {
		id 			: id
		,xtype		: 'grid'
		,store 		: store
		,columns 	: columns
		,autoLoad	: false
	}
}	// eo function

Other EXTJS - 网格onRowDblClick处理函数

/**
 * grids onRwDoubleClick
 */
var onRowDblClick = function (sm, rowIdx, e) {

	console.log('HO.Class.CRUD.onRowDblClick');
	console.log(this);
	console.log(this.ownerCt);
	console.log(sm);
	console.log(rowIdx);
	console.log(e);
	var rec = this.getStore().getAt(rowIdx);
	this.ownerCt.managerRef.show('ala','makota');
}	// eo function onRowDblClick

Other EXTJS - 远程加载网格的容器

/**
 * Container for a remotely loaded grid
 */

HO.Class.CRUD.prototype.defineGridContainer = function () {		
	this.GridContainer = {
	     id				: 'GridContainer'
	    ,title			: 'grid'
	    ,loadScripts	: true
		,layout			: 'fit'
		,plugins		: [this.Grid]
		,managerRef		: this			// !!!!!!! a reference to managing object, this object, because this is our app logic
	    //,autoShow		: true
	 	,tbar: [{
	        text:'click me',
	        listeners: {
	            click: function(){ alert('test'); }
	        }
	    }]
	}
}	// eo function