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() { | |
| var script = document.createElement('script'); | |
| script.onload = function() { | |
| var stats = new MemoryStats(); | |
| var elem = stats.domElement; | |
| elem.style.position = 'fixed'; | |
| elem.style.right = '0px'; | |
| elem.style.bottom = '0px'; |
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
| javascript:(function(){var script=document.createElement('script');script.src='https://rawgit.com/paulirish/memory-stats.js/master/bookmarklet.js';document.head.appendChild(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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <!-- Required meta tags --> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
| <!-- Bootstrap CSS --> | |
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> |
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
| const arr1 = ['a', 'b']; | |
| const arr2 = ['c', 'd']; | |
| const arr3 = arr1.concat(arr2); | |
| console.log(arr3); // 👉️ ['a', 'b', 'c', 'd'] | |
| //https://bobbyhadz.com/blog/javascript-append-one-array-to-another-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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style> | |
| #main { | |
| width: 100%; | |
| height: 150px; | |
| border: 1px solid #c3c3c3; | |
| display: -webkit-flex; /* Safari */ | |
| display: flex; |
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
| //http://localhost/news/?feed=9&adsfa=1 | |
| //http://localhost/news/?feed=8&adsfa=1 | |
| //seturlNew('feed', id); | |
| function seturlNew(key,value){ | |
| var t = new URLSearchParams(document.location.search); | |
| t.set(key, value); | |
| var n = window.location.pathname + "?" + t.toString(); | |
| window.history.pushState(null, "", n); |
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
| //https://stackoverflow.com/a/4814526 | |
| (function($) { | |
| $.fn.hasScrollBar = function() { | |
| return this.get(0).scrollHeight > this.get(0).clientHeight; | |
| } | |
| })(jQuery); | |
| //use |
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 now = new Date(); | |
| var utc = new Date(now.getTime() + now.getTimezoneOffset() * 60000); | |
| ///utc(int) | |
| //https://stackoverflow.com/a/11964609 |
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 fromNow(date, nowDate = Date.now(), rft = new Intl.RelativeTimeFormat(undefined, { numeric: "auto" })) { | |
| const SECOND = 1000; | |
| const MINUTE = 60 * SECOND; | |
| const HOUR = 60 * MINUTE; | |
| const DAY = 24 * HOUR; | |
| const WEEK = 7 * DAY; | |
| const MONTH = 30 * DAY; | |
| const YEAR = 365 * DAY; | |
| const intervals = [ | |
| { ge: YEAR, divisor: YEAR, unit: 'year' }, |
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
| <html> | |
| <head> | |
| <script> | |
| //http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml | |
| var glb_version = 'v=1234zd'; | |
| </script> | |
| <link rel="stylesheet" type="text/css" href="main.css" /> | |
| </head> | |
| <body> |