Tiny Node.js module to securely hash and compare passwords using pbkdf2 with per password random salt.
To hash a password:
var password = require('./password');| More recent resolution: | |
| 1. cd ~/../../etc (go to etc folder in WSL). | |
| 2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line). | |
| 3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line). | |
| 4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian). | |
| 5. cd ~/../../etc (go to etc folder in WSL). | |
| 6. sudo rm -Rf resolv.conf (Delete the resolv.conf file). | |
| 7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and | |
| secondary. |
| function typeOfUsername( inputString:string) : string { | |
| //Insert your code here | |
| if (inputString.length > 25) return 'invalid'; | |
| const vowels: string[] = ['a', 'e', 'i', 'o', 'u']; | |
| const numOfVowels = inputString.split('').filter((c) => vowels.includes(c)).length; | |
| const numOfConstants = inputString.length - numOfVowels; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // A common redux pattern when dealing with async functions is to use thunk. | |
| // This usually means your action returns a new function instead of an action object, | |
| // and the thunk middleware will make it all work. Example: | |
| const asyncAction = () => dispatch => setTimeout(() => dispatch(someOtherAction()), 10000); | |
| // Now: maybe that async stuff going on is calling some API which you don't want to overload | |
| // with request, and that's what debounce is for. | |
| // This is an example of a debounced function which will only be calleable once every second. | |
| import { debounce } from 'lodash'; | |
| const debouncedFn = debounce(() => callApi(), 1000, { leading: true, trailing: false }); |