Using Crafter CMS, GitHub, and Two-Factor Authentication

See the original posting on DZone Python

Crafter’s Git-based CMS supports developers working against remote repositories like GitHub, GitLab, Bitbucket, and others. Many organizations that use GitHub enforce a two-factor authentication for developers. This article shows you how to create a site in Crafter when you have two-factor authentication in GitHub configured.

Step 1: Configure an Access Token in GitHub

If you are reading this article, it’s very likely you already have two-factor authentication configured and are using it with GitHub. If you’re interested in setting it up you can learn more about that here.

Stop Using JWTs as Session Tokens

See the original posting on DZone Python

JSON Web Tokens (JWTs) are so hot right now. They’re all the rage in web development because they’re trendy, secure, scalable, and compact. With all these amazing things going for JWTs, they seem like an unstoppable hype train headed straight for Stack Overflow fame and fortune!

Today I’m here to talk with you about the downsides of using JWTs. Specifically, why it’s a bad idea to use JWTs as session tokens for most people.

CSS Bullet Style

See the original posting on DZone Python

Are you a fan of making lots and lots of lists? Neither am I. But, here we are not talking about chore or shopping lists. We are talking about ordered and unordered lists that are inevitable when making modern websites and apps.

As mentioned, when creating lists in HTML and CSS, there are two types: ordered and unordered. In the case of ordered lists, numeration is present. On the other hand, in the case of unordered lists, no numeration is present, which is why a common name for these types of lists is bulleted lists.

The ASP.NET Core React Project

See the original posting on DZone Python

In the last post I wrote, I had a first look at a plain, clean, and lightweight React setup. I’m still impressed how easy the setup is and how fast the loading of a React app really is. Before trying to push this setup into an ASP.NET Core application, it would make sense to have a look at the ASP.NET Core React project.

Create the React Project

You can either use the "File New Project …" dialog in Visual Studio 2017 or the .NET CLI to create a new ASP.NET Core React project:

Trying React the First Time

See the original posting on DZone Python

The last two years, I have worked a lot with Angular. I learned a lot and I also wrote some blog posts about it. While I worked with Angular, I always had React in mind and wanted to learn about that. But I never head the time or a real reason to look at it. I still have no reason to try it, but a little bit of time. So why not? 

This post is just a small overview of what I learned during the setup and in the very first attempts at using React.

Render Props in Stencil

See the original posting on DZone Python

Before I started to use Stencil, I worked a lot with React (and am still working with the library). While developing React components, you often need to use a render prop, so I wanted to see how it would work in a Stencil environment. As you might figure, it works in Stencil and this gave me the idea to write a short post to explain how to use the render prop in Stencil.

Render Prop

A render prop is just a name for a simple technique in which you pass a function to a component which will be used in the component render function. The reason to use a render prop is the ability for a component to share its inner state without exposing it to the outside.

4 Essential ES2015 Features for Vue.js Development

See the original posting on DZone Python

ES2015 (aka ES6) is the current specification of the JavaScript language. If you’re new to JavaScript or haven’t updated your JavaScript knowledge recently, there are a number of new features in ES2015 that make development much better and more enjoyable.

If you’re a Vue developer, you’d benefit from learning all these new features. But as a means of triage, you might start with those features that apply to Vue specifically.

Adding Font Awesome to a Yeoman Generated JET Project

See the original posting on DZone Python

Oracle JET, Oracle’s JavaScript toolkit for single page apps, includes over 80 components to help build enterprise JavaScript applications. But one thing JET doesn’t include is a set of icons – the argument being that different apps and teams will likely choose different icons. Luckily, it’s not too difficult to add Font Awesome to a JET app. If you’re using one of the starter apps without the Yeoman generator, have a look at Paul Thaden’s post on adding Font Awesome. In this post, I’ll show you how to add Font Awesome to a project created via the Yeoman generator.

For those who haven’t used it, Yeoman is a scaffolding tool designed to help kickstart new projects by running scripts called generators. Generators are often used to create opinionated starter apps with best practices and build scripts built in. The JET generator installs a sample app and includes a Grunt-based build system that can be customized as needed.

Zero to Express on OpenShift in Three Commands

See the original posting on DZone Python

With the recent announcement that Node.js is generally available as part of Red Hat OpenShift Application Runtimes, I wanted to see how easy it was to deploy an Express.js app on OpenShift.

Getting Started

Before we start, there are some required prerequisites. You need to have Node 8.x and npm 5.2 or greater installed. npm comes with the official node distribution, so if you install Node from Nodejs.org, you should be good.

Build a Secure To-Do App With Vue, ASP.NET Core, and Okta

See the original posting on DZone Python

I love lists. I keep everything I need to do (too many things, usually) in a big to-do list, and the list helps keep me sane throughout the day. It’s like having a second brain!

There are hundreds of to-do apps out there, but today I’ll show you how to build your own from scratch. Why? It’s the perfect exercise for learning a new language or framework! A to-do app is more complex than “Hello World”, but simple enough to build in an afternoon or on the weekend. Building a simple app is a great way to stretch your legs and try a language or framework you haven’t used before.

Git Branches

See the original posting on DZone Python

In the current era, most software development companies work in a collaborative environment where several developers contribute to the same source code. While some will be fixing bugs, others will be implementing new and different features. The problem arises, how do you maintain different versions of the same code base?

This is where the branch function shines! Branch allows each developer to isolate his/her work from others by creating a new branch from the original code base.

A Generic Logger Factory Facade for Classic ASP.NET

See the original posting on DZone Python

ASP.NET Core already has this feature. There is a ILoggerFactory to create a logger. You are able to inject the ILoggerFactory to your component (Controller, Service, etc.) and to create a named logger out of it. During testing you are able to replace this factory with a mock, to not test the logger as well, and to not have an additional dependency to setup.

Recently, we had the same requirement in a classic ASP.NET project, where we used Ninject to enable dependency injection and log4net to log all the stuff we did and all the exceptions. One important requirement was creating a named logger per component.

JavaScript and Underscore.js Type Methods in PHP

See the original posting on DZone Python

I’ve been working with PHP since 2000 and with JavaScript even longer. Over the last decade, JavaScript has evolved drastically. It had a promising design from the very beginning and gained its current incredible shape with the shift to ES2015 (Harmony). PHP, though, didn’t change that much. Apparently, it’s doomed always to suffer from its own legacy. It arrived in the mid-90s as a simple CGI app to maintain Rasmus Lerdorf’s home page and have been more like spontaneously developing ever since. That resulted in syntax inconsistency, a mix of functional and OOP-based assets, and absence of a decent language specification. So every time I switch to PHP I miss the rationality, predictability, and flexibility of JavaScript. This made me consider a library which would bring a JavaScript-like development experience to PHP. Eventually, I came up with Extras, which extends PHP types with JavaScript (other than Underscore) methods, unlocks chaining, and introduces the PlainObject type representing an object-literal.

JavaScript Meets PHP

The library enriches with JavaScript and Underscore.js methods the following PHP types: array (both sequential and associative), string, number (integer, float, NaN), function (callable), collection (Iterable, ArrayObject, Iterator) and boolean. Every added method is a static method of the class representing the type. So we can access any directly, without the creation of a chain like Arrays::map.

Declarative D3 Transitions With React 16.3 [Video]

See the original posting on DZone Python

The new React 16.3 brings some changes to the ecosystem that change how we go about integrating React and D3 to build data visualizations.

componentWillReceiveProps, componentWillUpdate and compnentWillMount are on their way out. They were great for making React and D3 happy together, but they cause issues with the async rendering that the React team is planning for React 17.

Build Secure User Management With Vue.js, Node, and Okta

See the original posting on DZone Python

Many of us have danced the JavaScript framework shuffle for years starting with jQuery, then on to Angular. But Angular is complex, so we turn to React. With React, what seems simple on the surface can end up being a frustrating mess. Enter Vue.js. It works as expected. It’s fast. The documentation is incredible. Templating is eloquent.

There’s a unanimous consensus around how to handle state management, conditional rendering, two-way binding, routing, and more. I’ve seen so many developer’s walk this same path, so today I want to take you through how to build a basic app with Vue.js and Node. This tutorial will take you step by step through scaffolding a Vue.js project, offloading secure authentication to Okta’s OpenID Connect API (OIDC), locking down protected routes, and performing CRUD operations through a backend REST API server. This tutorial uses the following technologies but doesn’t require intimate knowledge to follow along:

Adding SVGs to PDFs With Python and ReportLab

See the original posting on DZone Python

ReportLab has native support for generating SVG, but not for embedding SVGs in their PDFs. Fortunately, Dinu Gherman created the svglib package, a pure-Python package that can read SVG files and convert them to other formats that ReportLab can use. The official website for svglib is on GitHub.

The svglib package will work on Linux, Mac OS, and Windows. The website states that it works with Python 2.7 – 3.5, but it should work in newer versions of Python as well.

1 2 3 108