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
| // Request storage usage and capacity left | |
| window.webkitStorageInfo.queryUsageAndQuota(webkitStorageInfo.TEMPORARY, | |
| //the type can be either TEMPORARY or PERSISTENT | |
| function(used, remaining) { | |
| console.log("Used quota: " + used + ", remaining quota: " + remaining); | |
| }, function(e) { | |
| console.log('Error', e); | |
| } ); |
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
| Full working sample actually is: | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js"></script> | |
| <br><br> | |
| <label>encrypted</label> | |
| <div id="demo1"></div> | |
| <br> | |
| <label>decrypted</label> |
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 params = "?q=Hello World&c=Awesome"; | |
| params = "{\"" + | |
| params | |
| .replace( /\?/gi, "" ) | |
| .replace( /\&/gi, "\",\"" ) | |
| .replace( /\=/gi, "\":\"" ) + | |
| "\"}"; | |
| params = JSON.parse( params ); |
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
| // 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 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
| // 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 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( 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 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
| /* | |
| 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 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
| at = function( test ){ | |
| try{ | |
| if( typeof test === "function" )return test(); | |
| return test || null; | |
| }catch( e ){ |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |