Dennis

1,099 Flips | 9 Magazines | 20 Likes | 3 Following | 148 Followers | @dennischew82 | Educator. Programmer. Photographer. Tweet me @jovialio

Encrypt and decrypt content with Nodejs - chris-rock

Nodejs offers great support for cryptography. Under the hood it uses openssl and ships with a Javascript api. Unfortunately the api is not always as …

Information Security

Where to Store JWTs - Cookies vs HTML5 Web Storage

<b>Update 5/12/2016:</b> Building a Java application? JJWT is a Java library providing end-to-end JWT creation and verification, developed by our very own …

Cookies vs Tokens: The Definitive Guide

<b>TL;DR</b> Tokens-based authentication is more relevant than ever. We examine the differences and similarities between cookie and token-based …

Why Does OAuth v2 Have Both Access and Refresh Tokens?

Section 4.2 of the draft OAuth 2.0 protocol indicates that an authorization server can return both an access_token (which is used to authenticate …

All You Ever Wanted to Know About Node.js Sessions

<b>Update 5/11/2016:</b> Trying to decide where to store your JWTs? Check out our post on Cookies vs. HTML Web Storage!<p>Want to build a Node.js web app that …

How to Create Totally Secure Cookies

Securing cookies and sessions is vital to keeping an application secure. Many tutorials have been written on the subject, but as the internet (and …

Using CORS

Introduction<p>APIs are the threads that let you stitch together a rich web experience. But this experience has a hard time translating to the browser, …

Web Development

CSRF Demystified

Cross-Site Request Forgery has been all over the press recently since several major sites and web applications were plagued by exploits and uncovered …

IT security

Local Storage vs Cookies

I want to reduce load times on my websites by moving all cookies into local storage since they seem to have the same functionality. Are there any …

Use JWT The Right Way!

<b>Update 5/11/2016:</b> You can now inspect JWTs directly from your Chrome browser with JWTinspector.io!<p>Also, check out the latest on JWTs + Stormpath in …

Securing Cookies with HttpOnly and secure Flags

<b>1. Introduction</b><p>Securing cookies is an important subject. Think about an authentication cookie. When the attacker is able to grab this cookie, he can …

How to Generate Unique Identifiers in Node.js

Generating a unique identifier is sometimes a very trivial job. All you need is to get an index of integer type and increment it any time you need an …

JavaScript

The Anatomy of a JSON Web Token

IntroductionThe API model has been used a great amount recently in applications. This has come about because applications can’t just rely on their …

JavaScript

use of module.exports as a constructor

According to the Node.js manual:<p>If you want the root of your module's export to be a function (such as a constructor) or if you want to export a …

JavaScript

An Antidote to the Age of Anxiety: Alan Watts on Happiness and How to Live with Presence

<i>“How we spend our days is, of course, how we spend our lives,”</i> Annie Dillard wrote in her timeless reflection on presence over productivity — a timely antidote to the central anxiety of our productivity-obsessed age. Indeed, my own New Year’s resolution has been to stop measuring my days by degree …

Nobody Wants To Use Your Product

Every morning, designers wake up to happily work on their products, be they digital or physical, with an inner belief that people will want to use …

Web Design

A Grammy Winner, A Circus Master, And An Apple Veteran On Career Reinvention

Stewart Copeland cofounded The Police. Kelli Richards grew up where her Apple office later stood. These are their career-change tips.<p>I grew up in Cupertino, California, before Apple ever existed. Later, I spent 12 years leading the company’s music and entertainment business. My office at the time …

The Incalculable Value of Finding a Job You Love

Social scientists have been trying to identify the conditions most likely to promote satisfying human lives. Their findings give some important clues about choosing a career: Money matters, but as the economist Richard Easterlin and others have demonstrated, not always in the ways you may …

Workplace Safety

How does a web session work ?

Not long ago I had to investigate on a session reset bug that forced me to do some research on sessions. Since I didn’t find the subject well …

Scraping the Web With Node.js

Before web based API's became the prominent way of sharing data between services we had web scraping. Web scraping is a technique in data extraction …

JavaScript

Differences between express.Router and app.get?

I'm starting with NodeJS and Express 4, and I'm a bit confused. I been reading the express website, but can't see _when to use a route handler or …

Node.js

Difference between app.all('*') and app.use('/')

Node.js

Anki’s New SDK Makes It Easier For Nonexperts To Write Code For Robots

The SDK for Anki’s Cozmo gives everyone access to face and motion detection technology–without requiring a PhD in robotics.<p>Let me tell you something I bet you probably already know: Writing code for robots is really hard.<p>While your average tech-savvy hobbyist or undergrad can probably fumble their …

Difference between "git add -A" and "git add ."

The command git add [--all|-A] appears to be identical to git add .. Is this correct? If not, how do they differ?<p>git …

Git

Isomorphic React Apps with React-Engine

Earlier this year, we started using react in our various apps at PayPal. For existing apps the plans were to bring react in incrementally for new …

JavaScript

Using mustache.js along with node.js?

After becoming fond with mustache.js template-style, I would like continue using it in node.js.<p>I've been able to install it and confirm that it's …

Understanding JavaScript’s async await

Earlier this week we took a look at new features coming in ES2016. Today we’ll learn about async / await.The async / await feature didn’t make the …

JavaScript

Learning React.js: Getting Started and Concepts

Introduction<p><i>Update</i>: This article has been updated for React 16!<p>Today we are going to kick off the first installment in a new series of tutorials,</b> …

React Tutorial 1.5: Utilizing Webpack and Babel to build a React.js App

Let me preface this section by saying that Webpack is hard. Partially because it’s an extremely powerful tool and partially because the documentation …

JavaScript

Clearing require cache

I am trying to delete a module from cache as suggested here.<p>In the documentation we read:<p>require.cache<p>Object<p>Modules are cached in this object when …

JavaScript