- Docs are simply not clear
- req.isAuthenticated() undocumented
- Passport Session not being initialised / req.user is undefined
- serializeUser/deserializeUser function can take a req but this is undocumented?
- SO-node-express-passport-req-user-undefined
- SO-understanding-passport-serialize-deserialize
- Getting Passport to work nicely with GraphQL shows some rough edges in Passport. Node could use some more innovation on the auth side
- [Questions regarding passport/sessions/redis](https://www.reddit.com/r/node/comments/830x7v/questions_regarding_passpor
{ | |
"extends": ["react-app", "plugin:prettier/recommended"] | |
} |
// This is an advanced example! It is not typically required for application code. | |
// If you are using a library like Redux or MobX, use the container component provided by that library. | |
// If you are authoring such a library, use the technique shown below. | |
// This example shows how to safely update subscriptions in response to props changes. | |
// In this case, it is important to wait until `componentDidUpdate` before removing a subscription. | |
// In the event that a render is cancelled before being committed, this will prevent us from unsubscribing prematurely. | |
// We also need to be careful about how we handle events that are dispatched in between | |
// `getDerivedStateFromProps` and `componentDidUpdate` so that we don't put stale values into the `state`. |
var r1 = /(\$|£|€)\d+(k|K)/m | |
var r2 = /\d+-\d+(k|K)/m | |
var r3 = /\d+(k|K)\s?(€|EUR)/m | |
var candidates = [r1, r2, r3]; | |
var linkQueue = [] | |
var comments = document.getElementsByTagName("tr") | |
for (var i in comments) { | |
var comment = comments[i]; | |
if (comment.className && comment.className.indexOf("athing comtr") != -1) { |
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [{ | |
"name": "Chrome", | |
"type": "chrome", | |
"request": "launch", | |
"url": "http://localhost:3000", |
For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft
import React from 'react'; | |
import lively from 'lively'; | |
// Global registry and resize handler | |
let _registeredInstances = []; | |
function register(inst) { | |
if (_registeredInstances.length === 0) { | |
window.addEventListener('resize', onResize); | |
} |
Tests are interesting, because you're trying to test code. But to write tests, you have to write code. Who tests the tests? For tests to be worth it you need to be sure that for each line of code you add, the value being added is more than the liability.
Value > Liability
Because belive me, tests are a liability. First, they are code that
// | |
// MIT License | |
// | |
// Copyright (c) 2018 Ali Sharif | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is |