This document details some tips and tricks for creating redux containers. Specifically, this document is looking at the mapDispatchToProps argument of the connect function from [react-redux][react-redux]. There are many ways to write the same thing in redux. This gist covers the various forms that mapDispatchToProps can take.
| // This is an advanced example! It is not intended for use in application code. | |
| // Libraries like Relay may make use of this technique to save some time on low-end mobile devices. | |
| // Most components should just initiate async requests in componentDidMount. | |
| class ExampleComponent extends React.Component { | |
| _hasUnmounted = false; | |
| state = { | |
| externalData: null, | |
| }; |
| self.addEventListener('install', (e) => { | |
| e.waitUntil( | |
| caches.open("precache").then((cache) => cache.add("/broken.png")) | |
| ); | |
| }); | |
| function isImage(fetchRequest) { | |
| return fetchRequest.method === "GET" && fetchRequest.destination === "image"; | |
| } |
https://webkit.org/blog/10218/full-third-party-cookie-blocking-and-more/
I've created to test it, but I'm confused by the result. https://animated-caribou.glitch.me/
- Chrome: only display the cookie value with SameSite=None in iframe.
This is definitely not the first time I've written about this topic, but I haven't written formally about it in quite awhile. So I want to revisit why I think technical-position interviewing is so poorly designed, and lay out what I think would be a better process.
I'm just one guy, with a bunch of strong opinions and a bunch of flaws. So take these suggestions with a grain of salt. I'm sure there's a lot of talented, passionate folks with other thoughts, and some are probably a lot more interesting and useful than my own.
But at the same time, I hope you'll set aside the assumptions and status quo of how interviewing is always done. Just because you were hired a certain way, and even if you liked it, doesn't mean that it's a good interview process to repeat.
If you're happy with the way technical interviewing currently works at your company, fine. Just stop, don't read any further. I'm not going to spend any effort trying to convince you otherwise.
| const getRawBody = require("raw-body"); | |
| const { updateUserByCustomerId } = require("./_db.js"); | |
| const stripe = require("stripe")(process.env.STRIPE_SECRET_KEY, { | |
| apiVersion: process.env.STRIPE_API_VERSION, | |
| }); | |
| // Disable next.js body parsing (stripe needs the raw body to validate the event) | |
| export const config = { | |
| api: { |
| convert("one hundred five"); // "105" | |
| convert("six hundred and fifty three"); // "653" | |
| convert("zero zero one two three"); // "123" | |
| convert("twelve o three"); // "1203" | |
| convert("thirteen zero nine"); // "1309" | |
| convert("fifteen sixteen"); // "1516" | |
| convert("fourteen ninety two"); // "1492" | |
| convert("nineteen ten"); // "1910" | |
| convert("twelve hundred"); // "1200" | |
| convert("twenty three hundred"); // "2300" |
| // Free to use | |
| // Written by Alexis Bridoux - https://github.com/ABridoux | |
| import AppKit | |
| #if canImport(SwiftUI) | |
| import SwiftUI | |
| #endif | |
| // MARK: Model |
| export const finishJson5 = (unfinishedJson5: string) => { | |
| let stack = []; | |
| let inDoubleQuotes = false; | |
| let inSingleQuotes = false; | |
| let inSingleLineComment = false; | |
| for (let i = 0; i < unfinishedJson5.length; i++) { | |
| const currentChar = unfinishedJson5[i]; | |
| const nextChar = unfinishedJson5[i + 1]; | |
| let prevChar; |
| /* eslint-disable @typescript-eslint/no-explicit-any */ | |
| import type { Component } from "vue"; | |
| import { | |
| memo, | |
| useEffect, | |
| useLayoutEffect, | |
| useMemo, | |
| useRef, | |
| useState, | |
| useCallback, |