By using ReturnType
we don't have to manually write type for Context
See also gist for SolidJS https://gist.github.com/JLarky/a46055f673a2cb021db1a34449e3be07
And original tweet https://twitter.com/JLarky/status/1554152932425117697
const [ | |
open, // current state: opened or closed? | |
toggle // HIDDEN DISPATCH | |
] = useReducer( | |
state => !state, // a reducer that, umm, ignores its action? | |
false // initial state: open = false | |
) |
By using ReturnType
we don't have to manually write type for Context
See also gist for SolidJS https://gist.github.com/JLarky/a46055f673a2cb021db1a34449e3be07
And original tweet https://twitter.com/JLarky/status/1554152932425117697
package.json
by running yarn version --prerelease --preid=canary
npm publish --tag canary
to publish the package under the canary
tagyarn add @artsy/reaction@canary
to install canary packageRunning npm dist-tag ls
can be helpful to see what tagged packages are available
interface ZendeskWidget { | |
( | |
type: 'webWidget:on' | 'webWidget' | 'webWidget:get', | |
command: string, | |
payload?: any, | |
): void; | |
( | |
type: 'webWidget', | |
command: 'updateSettings', | |
payload: ZendeskSettings, |
TLDR: JWTs should not be used for keeping your user logged in. They are not designed for this purpose, they are not secure, and there is a much better tool which is designed for it: regular cookie sessions.
If you've got a bit of time to watch a presentation on it, I highly recommend this talk: https://www.youtube.com/watch?v=pYeekwv3vC4 (Note that other topics are largely skimmed over, such as CSRF protection. You should learn about other topics from other sources. Also note that "valid" usecases for JWTs at the end of the video can also be easily handled by other, better, and more secure tools. Specifically, PASETO.)
A related topic: Don't use localStorage (or sessionStorage) for authentication credentials, including JWT tokens: https://www.rdegges.com/2018/please-stop-using-local-storage/
The reason to avoid JWTs comes down to a couple different points:
While a lot of Node.js guides recommend using JWT as an alternative to session cookies (sometimes even mistakenly calling it "more secure than cookies"), this is a terrible idea. JWTs are absolutely not a secure way to deal with user authentication/sessions, and this article goes into more detail about that.
Secure user authentication requires the use of session cookies.
Cookies are small key/value pairs that are usually sent by a server, and stored on the client (often a browser). The client then sends this key/value pair back with every request, in a HTTP header. This way, unique clients can be identified between requests, and client-side settings can be stored and used by the server.
Session cookies are cookies containing a unique session ID that is generated by the server. This session ID is used by the server to identify the client whenever it makes a request, and to associate session data with that request.
*S
I have spent quite a bit of time figuring out automounts of NFS shares in OS X...
Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:
/etc/auto_master (see last line):
#
# Automounter master map
#
+auto_master # Use directory service
%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- | |
%% ex: ts=4 sw=4 et | |
%% @author Kevin Smith <[email protected]> | |
%% @copyright 2011 Opscode, Inc. | |
-module(example). | |
-behaviour(gen_server). | |
-export([start_link/0]). |
#!/bin/bash | |
# Unload the keyboard so I can use my external keyboard | |
# and not worry about accidentally pressing buttons on | |
# the built-in. This may not be a problem for you but, you | |
# should see my desk sometimes (Oh no!!) ;-) | |
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ |