Available Packages:
| Path | Version | Description |
|---|---|---|
| add-ons;addon-google_apis-google-15 | 3 | Google APIs |
| add-ons;addon-google_apis-google-16 | 4 | Google APIs |
| add-ons;addon-google_apis-google-17 | 4 | Google APIs |
| add-ons;addon-google_apis-google-18 | 4 | Googl |
| function downloadItem(url) { | |
| var reader = new FileReader(); | |
| fetch(url).then((response) => { | |
| return response.blob() | |
| }).then((respBlob) => { | |
| reader.readAsDataURL(respBlob); | |
| reader.onloadend = function() { | |
| let elem = document.createElement('a'); | |
| elem.download = "true"; | |
| elem.href = reader.result; |
| import React, { useEffect, useRef } from 'react'; | |
| /** | |
| * Use setInterval with Hooks in a declarative way. | |
| * | |
| * @see https://stackoverflow.com/a/59274004/3723993 | |
| * @see https://overreacted.io/making-setinterval-declarative-with-react-hooks/ | |
| */ | |
| export function useInterval( | |
| callback: React.EffectCallback, |
Available Packages:
| Path | Version | Description |
|---|---|---|
| add-ons;addon-google_apis-google-15 | 3 | Google APIs |
| add-ons;addon-google_apis-google-16 | 4 | Google APIs |
| add-ons;addon-google_apis-google-17 | 4 | Google APIs |
| add-ons;addon-google_apis-google-18 | 4 | Googl |
Just migrated it from Codepen.io to markdown. Credit goes to David Conner.
| Working with DOM | Working with JS | Working With Functions |
|---|---|---|
| Accessing Dom Elements | Add/Remove Array Item | Add Default Arguments to Function |
| Grab Children/Parent Node(s) | Add/Remove Object Properties | Throttle/Debounce Functions |
| Create DOM Elements | Conditionals |
Table of Contents generated with DocToc
| <?php | |
| function base64url_encode($data) { | |
| return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); | |
| } | |
| function base64url_decode($data) { | |
| return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT)); | |
| } | |
| ?> |