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
| // FUNCIONES AUXILIARES | |
| /* | |
| * La siguiente función cuenta las propiedades | |
| * (tanto propias como hereradas) de un objeto | |
| */ | |
| function contarPropiedades(obj) { | |
| var recuento = 0; | |
| for (propiedad in obj) recuento ++; |
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 aplaneitor2(arr,sep){ | |
| return function step(a){return Array.isArray(a) ? a.map(step).join(sep) : a}(arr); | |
| } | |
| var test = ["hola", ["soy", ["juan", "fernandez"] ], "y", ["no", "tengo", ["dinero"] ] ]; | |
| console.log(aplaneitor2(test,'**')) // -> hola**soy**juan**fernandez**y**no**tengo**dinero |
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
| /* Abstracción!!! | |
| * | |
| * En la función aplaneitor de https://gist.github.com/1143902 | |
| * podemos apreciar el esquema foldl (reduce) | |
| * En esta versión se ha generalizado dicha función | |
| * obteniendo una versión de foldl valido para "árboles de arrays" | |
| */ | |
| function foldl(f,acu,soa) { | |
| if (soa instanceof Array) { |
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 phineas = (function(){ | |
| function aplaneitor(soa,acu) { | |
| if (soa instanceof Array) { | |
| for (var j=0, len = soa.length;j<len;j++) { | |
| aplaneitor(soa[j],acu); | |
| } | |
| } | |
| else { | |
| acu.push(soa); | |
| } |
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
| /* Son objetivos fundamentales: | |
| * - Minimizar las funciones ECMAScript utilizadas | |
| * - Optimizar en espacio, evitando la creación de arrays transitorios | |
| * | |
| * Suponemos que no se utilizará esta función con arrays creados | |
| * en frames externos, con lo cual instanceof Array es seguro | |
| */ | |
| function aplaneitor(soa,acu) { | |
| if (soa instanceof Array) { |
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 concatenate = (function(){ | |
| var params; | |
| //Auxiliares "privados" | |
| function hasElements(){return params.length>0;} | |
| function createString(){ | |
| var res = ""; | |
| for(var i=0;i<params.length;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
| /** | |
| * HumaneJS | |
| * Humanized Messages for Notifications | |
| * @example | |
| * humane('hello world'); | |
| */ | |
| ;(function(win,doc){ | |
| var eventOn, eventOff; | |
| if (win.addEventListener) { |
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
| /********************************************************************** | |
| Current Version: unnecessary scope | |
| **********************************************************************/ | |
| eventOn('load',function(){ | |
| transitionSupported = (function(style){ //Surplus | |
| var prefixes = ['MozT','WebkitT','OT','msT','KhtmlT','t']; | |
| for(var i = 0, prefix; prefix = prefixes[i]; i++){ | |
| if(prefix+'ransition' in style) return true; | |
| } | |
| return 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
| /*********************************************************************** | |
| Initial Version | |
| ************************************************************************/ | |
| var eventOn = function(type,fn){ win.addEventListener ? | |
| win.addEventListener(type,fn,false) : | |
| win.attachEvent('on'+type,fn)}, | |
| eventOff = function(type,fn){ win.removeEventListener ? | |
| win.removeEventListener(type,fn,false) : | |
| win.detachEvent('on'+type,fn)}, |
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
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ;; Defining a module | |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| (module (sillymul) | |
| ;;The body | |
| (begin | |
| ;;Private |