Underscore example:
_.each([1, 2, 3], function(num) { alert(num); });| # ============== shell | |
| # Case-insensitive globbing. | |
| shopt -s nocaseglob; | |
| # Do not overwrite files when redirecting using ">", ">&" or "<>". | |
| # Note that you can still override this with ">|". | |
| set -o noclobber; | |
| # UTF-8 all the way. | |
| export LC_ALL='en_GB.UTF-8'; |
| var svg = document.getElementById('graph'), | |
| xml = new XMLSerializer().serializeToString(svg), | |
| data = "data:image/svg+xml;base64," + btoa(xml), | |
| img = new Image() | |
| img.setAttribute('src', data) | |
| document.body.appendChild(img) |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| /*! | |
| * tableToD3Chart(); | |
| * Author: Joe Watkins - joe@emergeinteractive.com | |
| * | |
| * Scrape the dom for data and create C3/D3 based charts | |
| * | |
| * Defaults: | |
| * chartTitleWrapper = the element wrapping text for chart label | |
| * chartType = line, pie, donut, bar, spline, scatter etc. - see C3 docs | |
| * useDom = true/false - if you don't want to scrape dom and want to define data use false |
Example:
zsh-5.7.1-1-x86_64.pkg.tar.xz
Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.
You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.
You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)
Don't like Next? Here's how to do the same in Gatsby.
| // 1. Log in to your Amazon account | |
| // 2. Go to your Content Library > Books - https://www.amazon.com/hz/mycd/digital-console/contentlist/booksAll/dateDsc/ | |
| // 3. Open your browser's Javascript console | |
| // 4. For each page of books, paste this script into the console | |
| (async function () { | |
| // Close the notification if it appears | |
| function closeNotification() { | |
| const notifClose = document.querySelector("span#notification-close"); | |
| if (notifClose) { |
| // ==UserScript== | |
| // @name Kindle Download | |
| // @namespace http://tampermonkey.net/ | |
| // @version 2025-02-20 | |
| // @description Download all your kindle books | |
| // @author You | |
| // @match https://www.amazon.com/hz/mycd/digital-console/contentlist/booksPurchases/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=amazon.com | |
| // @grant none | |
| // ==/UserScript== |