-
-
Save renodesper/1d41e72ce1dfa9c9e251723b64d9245c to your computer and use it in GitHub Desktop.
Revisions
-
renodesper revised this gist
Dec 9, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,11 +2,11 @@ if (localStorage && !localStorage.getItem('size')) { var i = 0; try { // Test up to 10 MB for (i = 100; i <= 10000; i += 100) { localStorage.setItem('test', new Array((i * 1024) + 1).join('a')); } } catch (e) { localStorage.removeItem('test'); localStorage.setItem('size', i - 100); } } -
cdmckay revised this gist
Sep 12, 2014 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,5 @@ if (localStorage && !localStorage.getItem('size')) { } catch (e) { localStorage.removeItem('test'); localStorage.setItem('size', i - 250); } } -
cdmckay revised this gist
Sep 12, 2014 . 1 changed file with 5 additions and 9 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,13 @@ if (localStorage && !localStorage.getItem('size')) { var i = 0; try { // Test up to 10 MB for (i = 250; i <= 10000; i += 250) { localStorage.setItem('test', new Array((i * 1024) + 1).join('a')); } } catch (e) { localStorage.removeItem('test'); localStorage.setItem('size', i - 250); } } -
cdmckay revised this gist
Sep 12, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,6 @@ if (!localStorage.getItem('size')) { } } catch (e) { localStorage.removeItem('test'); localStorage.setItem('size', i ? i - 250 : 0); } } -
cdmckay revised this gist
Sep 12, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,6 @@ if (!localStorage.getItem('size')) { } } catch (e) { localStorage.removeItem('test'); localStorage.setItem('size', i - 250); } } -
cdmckay created this gist
Sep 12, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ function gen(n) { return new Array((n * 1024) + 1).join('a') } // Determine size of localStorage if it's not set if (!localStorage.getItem('size')) { var i = 0; try { // Test up to 10 MB for (i = 0; i <= 10000; i += 250) { localStorage.setItem('test', gen(i)); } } catch (e) { localStorage.removeItem('test'); localStorage.setItem('size', i); } }