Skip to content

Instantly share code, notes, and snippets.

/*
* join function for Java
*
* example
* List<String> list = new ArrayList<String>();
* list.add("hogehoge");
* list.add("fugafuga");
* list.add("piyopiyo");
* join(list,"&");// hogehoge&fugafuga&piyopiyo
*
/*
* Brainf**k in JavaScript1.6
*/
function Cell(memory){
this._memory = memory || [];
if(!this._memory.length){
this._memory.push(this);
}
};
Cell.prototype._memory;
(function($,templateStr){
var MiniTemplate = function(template){
this.template = eval(['([\'',template.replace(/\$\{([^${}]+)\}/g,'\',{key:\'$1\'},\''),'\'])'].join(''));
};
MiniTemplate.prototype.merge = function(context){
var template = this.template || [];
var temp = [];
for(var i = 0; i < template.length; i++){
if(typeof template[i] == 'string'){
temp.push(template[i]);