This file contains 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 copyToClipboard( element ){ | |
var $temp = $( "<input>" ); | |
$( "body" ).append( $temp ); | |
$temp.val( $( element ).text() ).select(); | |
document.execCommand( "copy" ); | |
This file contains 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
/* | |
Density 1.0.0 | |
Misura la densità delle parole, ovvero conta la presenza di ogni parola | |
// Default RegExp // | |
([a-zA-Z0-9]{2,100}[a-zA-Z0-9\-]{0,100}[a-zA-Z0-9]{3,100}){1,100} | |
// Restituisce un array ordinato dal valore più grande al più piccolo |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
at = function( test ){ | |
try{ | |
if( typeof test === "function" )return test(); | |
return test || null; | |
}catch( e ){ |
This file contains 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
/* | |
IDEA : | |
Monitorare il cambiamento di una variabile, per fare questo | |
dobbiamo utilizzare un oggetto che ci fornisce la possibilità | |
di utilizare una variabile di qualsiasi tipo purché non sia una | |
funzione ( JSON compatibile ) . | |
In sintesi ogni volta che cambia l'oggetto questo esegue una |
This file contains 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( tools, libs ){ | |
// Iterator | |
var require = function( scripts, onEnd ){ | |
onEnd = onEnd || function(){}; | |
if( !scripts || scripts.length < 1 )return onEnd(); | |
var src = scripts.splice( 0, 1), |
This file contains 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
// MD5 Lib, very fast, https://github.com/satazor/js-spark-md5 | |
(function(factory){if(typeof exports==="object"){module.exports=factory()}else if(typeof define==="function"&&define.amd){define(factory)}else{var glob;try{glob=window}catch(e){glob=self}glob.SparkMD5=factory()}})(function(undefined){"use strict";var add32=function(a,b){return a+b&4294967295},hex_chr=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function cmn(q,a,b,x,s,t){a=add32(add32(a,q),add32(x,t));return add32(a<<s|a>>>32-s,b)}function md5cycle(x,k){var a=x[0],b=x[1],c=x[2],d=x[3];a+=(b&c|~b&d)+k[0]-680876936|0;a=(a<<7|a>>>25)+b|0;d+=(a&b|~a&c)+k[1]-389564586|0;d=(d<<12|d>>>20)+a|0;c+=(d&a|~d&b)+k[2]+606105819|0;c=(c<<17|c>>>15)+d|0;b+=(c&d|~c&a)+k[3]-1044525330|0;b=(b<<22|b>>>10)+c|0;a+=(b&c|~b&d)+k[4]-176418897|0;a=(a<<7|a>>>25)+b|0;d+=(a&b|~a&c)+k[5]+1200080426|0;d=(d<<12|d>>>20)+a|0;c+=(d&a|~d&b)+k[6]-1473231341|0;c=(c<<17|c>>>15)+d|0;b+=(c&d|~c&a)+k[7]-45705983|0;b=(b<<22|b>>>10)+c|0;a+=(b&c|~b&d)+k[8]+1770035416|0 |
This file contains 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
// Like '@' for php - supress error - at( function(){} ); | |
window.at=function(a){try{return"function"==typeof a?a():a||null}catch(a){return null}}; |
This file contains 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 params = "?q=Hello World&c=Awesome"; | |
params = "{\"" + | |
params | |
.replace( /\?/gi, "" ) | |
.replace( /\&/gi, "\",\"" ) | |
.replace( /\=/gi, "\":\"" ) + | |
"\"}"; | |
params = JSON.parse( params ); |
OlderNewer