A Simple Bootstrap Drop-down Menu For React

Description:

Create simple and beautiful Bootstrap drop-down menu for your React project. It will work just like a user setting drop-down menu on the top right. The drop-down menu will open on ‘Click’ event.

How to use it?

1. Install the component with npm.

npm install react-bootstrap-dropdown-menu –save

2. Include the Bootstrap library if not included in your project.

<link href=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css” rel=”stylesheet” media=”all”>

3. Import the component.

import React from ‘react’;
import { DropdownMenu, MenuItem } from ‘react-bootstrap-dropdown-menu’;

4. Create the drop-down menu as following.

class SettingsMenu extends React.Component {
constructor() {
super();
this.deleteAccount = this.deleteAccount.bind(this);
this.logout = this.logout.bind(this);
}

deleteAccount(e) {
console.log(“Deleting Account”)
}

logout(e) {
console.log(“Logging out”)
}

render() {
return (
<DropdownMenu userName=”Chris Smith”>
<MenuItem text=”Home” location=”/home” />
<MenuItem text=”Edit Profile” location=”/profile” />
<MenuItem text=”Change Password” location=”/change-password” />
<MenuItem text=”Privacy Settings” location=”/privacy-settings” />
<MenuItem text=”Delete Account” onClick={this.deleteAccount} />
<MenuItem text=”Logout” onClick={this.logout} />
</DropdownMenu>
);
}
}

export default SettingsMenu;

The post A Simple Bootstrap Drop-down Menu For React appeared first on Lipku.com.

Flatlogic Admin Templates banner

.NET Foundation Election 2021 Nominations are Open!

.NET Foundation Election 2021 Nominations are Open!

It’s that time of the year again, dear friends – nominations are now open for the 2021 .NET Foundation Election! On behalf of the Board and Nomination Committee, we would like to welcome all of you to participate in whatever way you can: by applying as a candidate yourself, suggesting somebody else, or simply preparing to vote and help spread the word.

As a board member, you get to influence and shape the future of one of the biggest platforms there is—.NET—and everything it entails. You won’t be doing this alone. You’ll be working side by side with other passionate souls on the board, committees, TSG, Microsoft, community members, and more. You can review the expectations for board members here.

We’ve made a few changes over the years as we’ve learned and grown with the community’s help, and last year we started with a staggered election to avoid swapping out everybody on the board. Therefore, this year we’ll select three new board members this time around, for a period of 1 or 2 years. We also decided to introduce a Nomination Committee to help with the process and narrow down the final list of candidates.

If you have any questions or concerns, please reach out to the Nomination Committee, as we are here to help. As a reminder, the Nomination Committee members have volunteered their time and are not current board members or candidates.

The nomination period closes on July 23rd.

Full Responsive Side Navigation For React using react-pro-sidebar

Description:

A fully customizable and responsive side navigation component for React, which comes with drop-down menus, nested sub-menu etc. This component is used by thousands of apps.

Features:

RTL support.
Unlimited number of nested sub menus.
Fully customizable as per your need.
Supports drop-down menus.
Supports custom styling.

How to use it?

1. You will need to install the component using npm or yarn.

#npm
npm install react-pro-sidebar

#yarn
yarn add react-pro-sidebar

2. Import the side navigation component, like this:

import { ProSidebar, Menu, MenuItem, SubMenu } from ‘react-pro-sidebar’;
import ‘react-pro-sidebar/dist/css/styles.css’;

3. React code to create side menu.

<ProSidebar>
<Menu iconShape=”square”>
<MenuItem icon={<FaGem />}>Dashboard</MenuItem>
<SubMenu title=”Components” icon={<FaHeart />}>
<MenuItem>Component 1</MenuItem>
<MenuItem>Component 2</MenuItem>
</SubMenu>
</Menu>
</ProSidebar>;

4. If you want then, you can create sidebar layout.

import { ProSidebar, SidebarHeader, SidebarFooter, SidebarContent } from ‘react-pro-sidebar’;

<ProSidebar>
<SidebarHeader>
{/**
* You can add a header for the sidebar ex: logo
*/}
</SidebarHeader>
<SidebarContent>
{/**
* You can add the content of the sidebar ex: menu, profile details, …
*/}
</SidebarContent>
<SidebarFooter>
{/**
* You can add a footer for the sidebar ex: copyright
*/}
</SidebarFooter>
</ProSidebar>;

The post Full Responsive Side Navigation For React using react-pro-sidebar appeared first on Lipku.com.

Flatlogic Admin Templates banner

Create Multi-level Side Navigation for React Project

Description:

Create beautiful minimal multi-level side navigation for your React project and its clean and easy to implement in your project.

How to use it?

1. You will need to install the component using npm or yarn like this:

#npm
npm install react-minimal-side-navigation

#yarn
yarn add react-minimal-side-navigation

2. Import the side navigation component.

import React from ‘react’;
import {Navigation} from ‘react-minimal-side-navigation’;
import ‘react-minimal-side-navigation/lib/ReactMinimalSideNavigation.css’;

3. Now create the side navigation bar using React code, like following.

function App() {
return (
<>
<Navigation
// you can use your own router’s api to get pathname
activeItemId=”/management/members”
onSelect={({itemId}) => {
// maybe push to the route
}}
items={[
{
title: ‘Dashboard’,
itemId: ‘/dashboard’,
// you can use your own custom Icon component as well
// icon is optional
elemBefore: () => <Icon name=”inbox” />,
},
{
title: ‘Management’,
itemId: ‘/management’,
elemBefore: () => <Icon name=”users” />,
subNav: [
{
title: ‘Projects’,
itemId: ‘/management/projects’,
// Requires v1.9.1+ (https://github.com/abhijithvijayan/react-minimal-side-navigation/issues/13)
elemBefore: () => <Icon name=”cloud-snow” />,
},
{
title: ‘Members’,
itemId: ‘/management/members’,
elemBefore: () => <Icon name=”coffee” />,
},
],
},
{
title: ‘Another Item’,
itemId: ‘/another’,
subNav: [
{
title: ‘Teams’,
itemId: ‘/management/teams’,
},
],
},
]}
/>
</>
);
}

The post Create Multi-level Side Navigation for React Project appeared first on Lipku.com.

Flatlogic Admin Templates banner

Adding blog posts to your GitHub README with GitHub Actions

This article will discuss about adding your blog posts to your Github readme with Github Actions. You can add a README file to a repository to communicate important information about your project. You can find for more details about the GitHub readme from here

I was looking into some automation aspect related to GitHub readme automation – I was looking into some solution using Azure Functions and Logic Apps. And I found few solutions as well. But later I found one simple solution using GitHub Actions. Here is the GitHub Action which will run every day and use your blog RSS feed and update your Readme file.

You can create an GitHub Action and add the following code.

name: Blog posts on ReadMe
on:
schedule:
# Runs every day at 9am UTC
cron: 0 4 * * *’

jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
uses: actions/[email protected]
name: Get RSS Feed
uses: kohrongying/[email protected]
with:
feed_url: https://dotnetthoughts.net/feed
count: 10
name: Commit file changes
run: |
git config –global user.name ‘anuraj’
git config –global user.email ‘[email protected]
git add .
git diff –quiet –cached || git commit -m “Update README”
name: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

And here is the screenshot of the GitHub Action running.

And here is the Updated Readme file.

This way you will be able to update your blog posts automatically in to your GitHub readme file with the help of GitHub Actions.

Happy Programming 🙂

Flatlogic Admin Templates banner

Building Minimal APIs In .NET 6

Around 6-ish years ago, NodeJS really hit it’s peak in popularity. In part, it was because people had no choice but to learn Javascript because of the popularity of front end JS frameworks at the time, so why not learn a backend that uses Javascript too? But also I think it was because of the simplicity of building API’s in NodeJS.

Remember at the time, you were dealing with .NET Framework’s bloated web template that generated things like an OWIN pipeline, or a global.asax file. You had things like MVC filters, middleware, and usually we were building huge multi tier monolithic applications.

I remember my first exposure to NodeJS was when a company I worked for was trying to build a microservice that could do currency conversions. The overhead of setting up a new .NET Framework API was overwhelming compared to the simplicity of a one file NodeJS application with a single endpoint. It was really a no brainer.

If you’ve followed David Fowler on Twitter at any point in the past couple of years, you’ve probably seen him mention several times that .NET developers have a tendency to not be able to create minimal API’s at all. It always has to be a dependency injected, 3 tier, SQL Server backed monolith. And in some ways, I actually agree with him. And that’s why, in .NET 6, we are getting the “minimal API” framework to allow developers to create micro APIs without the overhead of the entire .NET ecosystem weighing you down.

Getting Setup With .NET 6 Preview

At the time of writing, .NET 6 is in preview, and is not currently available in general release. That doesn’t mean it’s hard to set up, it just means that generally you’re not going to have it already installed on your machine if you haven’t already been playing with some of the latest fandangle features.

To get set up using .NET 6, you can go and read out guide here : https://dotnetcoretutorials.com/2021/03/13/getting-setup-with-net-6-preview/

Remember, this feature is *only* available in .NET 6. Not .NET 5, not .NET Core 3.1, or any other version you can think of. 6.

Introducing The .NET 6 Minimal API Framework

In .NET 5, top level programs were introduced which essentially meant you could open a .cs file, write some code, and have it run without namespaces, classes, and all the cruft holding you back. .NET 6 minimal API’s just take that to another level.

With the .NET 6 preview SDK installed, open a command prompt in a folder and type :

dotnet new web -o MinApi

Alternatively, you can open an existing console application, delete everything in the program.cs, and edit your .csproj to look like the following :

<Project Sdk=”Microsoft.NET.Sdk.Web”>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
</Project>

If you used the command to create your project (And if not, just copy and paste the below), you should end up with a new minimal API that looks similar to the following :

using Microsoft.AspNetCore.Builder;

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.MapGet(“/hello”, () => “Hello, World!”);

app.Run();

This is a fully fledged .NET API, with no DI, no configuration objects, and all in a single file. Does it mean that it has to stay that way? No! But it provides a much lighter weight starting point for any API that needs to just do one single thing.

Of course, you can add additional endpoints, add logic, return complex types (That will be converted to JSON as is standard). There really isn’t much more to say because the idea is that everything is simple and just works out of the box.

Adding Dependency Injection

Let’s add a small addition to our API. Let’s say that we want to offload some logic to a service, just to keep our API’s nice and clean. Even though this is a minimal API, we can create other files if we want to right?!

Let’s create a file called HelloService.cs and add the following :

public class HelloService
{
public string SayHello(string name)
{
return $”Hello {name}”;
}
}

Next, we actually want to add a nuget package so we can have the nice DI helpers (Like AddSingleton, AddTransient) that we are used to. To do so, add the following package but ensure that the prerelease box is ticked as we need the .NET 6 version of the package, not the .NET 5 version.

Next, let’s head back to our minimal API file and make some changes so it ends up looking like so :

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSingleton<HelloService>(new HelloService());

var app = builder.Build();

app.MapGet(“/hello”, (HttpContext context, HelloService helloService) => helloService.SayHello(context.Request.Query[“name”].ToString()));

app.Run();

Here’s what we’ve done :

We added our HelloService as a dependency to our service collection (Much like we would with a full .NET API)
We modified our API endpoint to inject in our HttpContext and our HelloService
We used these to generate a response out, which should say “Hello {name}”. Nice!

We can obviously do similar things if we wish to load configuration. Again, you’re not limited by using the minimal API template, it’s simply just a way to give you an easier boilerplate for micro APIs that don’t come with a bunch of stuff that you don’t need.

Taking Things Further

It’s very early days yet, and as such, the actual layout and code required to build minimal API’s in .NET 6 is changing between preview releases. As such, be careful reading other tutorials out on the web on the subject, because they either become outdated very quickly *or* more often than not, they guess what the end API will look like, and not what is actually in the latest release. I saw this a lot when Records were introduced in C# 9, where people kinda “guessed” how records would work, and not how they actually did upon release.

So with that in mind, keep an eye on the preview release notes from Microsoft. The latest version is here : https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-6-preview-6/ and it includes how to add Swagger to your minimal API. Taking things further, don’t get frustrated if some blog you read shares code, and it doesn’t work, just keep an eye on the release notes and try things as they come out and are available.

Early Adopter Bonus

Depending on when you try this out, you may run into the following errors :

Delegate ‘RequestDelegate’ does not take 0 arguments

This is because in earlier versions of the minimal framework, you had to cast your delegate to a function like so :

app.MapGet(“/”, (Func)(() => “Hello World!”));

In the most recent preview version, you no longer have to do this, *but* the tooling has not caught up yet. So building and running via Visual Studio isn’t quite working. To run your application and get past this error, simply use a dotnet build/dotnet run command from a terminal and you should be up and running. This is actually a pretty common scenario where Visual Studio is slightly behind an SDK version, and is just what I like to call an “early adopter bonus”. If you want to play with the latest shiny new things, sometimes there’s a couple of hurdles getting there.

The post Building Minimal APIs In .NET 6 appeared first on .NET Core Tutorials.

Flatlogic Admin Templates banner

Dew Drop – July 16, 2021 (#3486)

Top Links

The Future of Xamarin Community Toolkit (Brandon Minnick)

Debug code with force run to cursor (Harshada Hole)

New TwoPaneLayout Compose library preview (Joy Liu)

XAML Live Preview and the Future of Designers for App Development (Nick Randolph)

An Emoji For Your Thoughts. Microsoft’s new emojis (Claire Anderson)

Web & Cloud Development

Exploring Next.js 11: What Is New (David Adeneye Abiodun)

You Can Do That With A JavaScript Data Grid? (Zara Cooper)

What’s New in 2021 Volume 2: Blazor Scheduler (Mahesh Palanisamy)

CSS Grid Cheat Sheet (Mariana Simon)

Fully Sharded Data Parallel: faster AI training with fewer GPUs (Myle Ott, Sam Shleifer, Min Xu, Priya Goyal, Quentin Duval & Vittorio Caggiano)

Server-Side Engine in JavaScript Pivot Table: An Overview (Ramesh)

What use cases exist for async_hooks? (Node.js Team)

Adding User Profiles to Static Web Apps (Aaron Powell)

API vs. Microservices: A Beginners Guide to Understand Them (Jaden Baptista)

WinUI, .NET MAUI & XAML

Getting started with a UI and not die trying in Xamarin Forms (Leomaris Reyes)

Everything You Need to Know About WinUI 3 Slider (Sheik Syed)

Visual Studio & .NET

Build and Debug C++ with WSL 2 Distributions and Visual Studio 2022 (Erika)

Software Architecture with C# 9 and .NET 5 – Book Review (Joseph Guadagno)

Get a Reward for Sharing Your dotTrace or dotMemory Experience (Anastasia Kazakova)

Design, Methodology & Testing

Azure DevOps Server 2020.1.1 RC now available (Gloridel Morales)

Creating reusable build scripts with NUKE components – How can we take advantage of the latest C# features to create highly reusable build scripts with NUKE? (Erik Heemskerk)

Assessing Remote Employee Experiences for Hybrid-Remote Work-Settings (Ben Linders)

Indigo.Design App Builder July Release – GitHub integration, Drag & Drop and more (Danail Marinov)

11 Git Commands I Use Every Day (Domagoj Vidovic)

Domain-Driven Refactoring: Procedural Beginnings (Jimmy Bogard)

5 learnings as a Product Manager (Kitty Bhasin)

Mindful Work: Capturing, Prioritizing and Working on Tasks Effectively (Roxana Murariu)

7 Key Insights of  Product Management (Sandra Davey)

How To Instill An Ownership Mindset In Your Team (Sarah Ribeiro)

Mobile, IoT & Game Development

Use These Dart/Flutter Packages for More Beautiful UIs (Mirsaid İsmailov)

New AppCode 2021.2 EAP: Completion for Documentation Tags in Swift and Bug Fixes (Stanislav Dombrovsky)

Podcasts, Screencasts & Videos

Kubernetes Podcast from Google – Gatekeeper and Policy Controller, with Max Smythe (Craig Box & Adam Glick)

CppCast – Improving Performance with Ivica Bogosavljevic (Rob Irving)

Hanselminutes – New Ways to Teach Computer Science with Maria Naggaga (Scott Hanselman)

Angular and Routing Testing – Part 2 featuring Lars Brink – AiA 317 (Charles Max Wood & Richard Sithole)

Using SQL Data Sync for Bidirectional Data Replication in SQL Server and Azure SQL DBs | Data Exposed (Anna Hoffman & Mara-Florina Steiu)

AzureFunBytes Episode 51 – Deploy With ARM Templates with @shankuehn (Jay Gordon)

Evaluating Jobs and Job Offers – Adventures in DevOps 077 (Charles Max Wood, Jeffrey Groman & Will Button)

Rocket 342: Goodbye, Fleets (Christina Warren, Brianna Wu & Simone De Rochefort)

AWS Developers Podcast Episode 005 – Future of Cloud Development Kit with Elad Ben-Israel (David Isbitski)

UX Podcast #267 – UX Theatre with Tanya Snook (James Royal-Lawson & Per Axbom)

React Native Radio #204 – Own Your Dependencies with Mark Rickert (Jamon Holmgren, Jon Major Condon & Mark Rickert)

Creating data-driven web applications with Django [1 of 24] | Beginner’s Series to: Django | Beginner’s Series to: Django (Matthew Leib)

Talk Python to Me #325: MicroPython + CircuitPython (Michael Kennedy)

Collaborative Debugging (Ozcode)

It’s Not for People – Windows Weekly 733 (Paul Thurrott)

OSS Power-Ups: Verify – Webinar Recording (Matthias Koch)

What’s next for GraphQL tooling? (Michael Staib)

Community & Events

Save the Date for .NET Conf: Focus on F#, July 29th, 2021 (Halah Villalobos)

Twitter Inclusion & Diversity Report July 2021: Cultivating Inclusion (Dalana Brand)

Healthcare Software Industry Trusts Text Control (Bjoern Meyer)

Student leaders are taking GitHub Campus TV to the next level (Elise Hollowed)

Get inspired: partner with us on what’s next in Windows (Aidan Marcuss)

5 Years of Merge Conflict (James Montemagno)

Data Engineers of Netflix — Interview with Kevin Wylie (Netflix Technology Blog)

Database

SQL SERVER – Find Instance Name for Availability Group Listener (Pinal Dave)

Using SQL Data Sync for Bidirectional Data Replication in SQL Server and Azure SQL Databases (Marisa Brasile)

Why Are Linked Server Queries So Bad? (Brent Ozar)

SharePoint & MS Teams

First Look at Microsoft Teams 2.0 and First Look at Microsoft’s New Teams Peripherals (Brad Sams)

Microsoft Viva Enhanced Teams as A Platform (Joel Oleson)

Miscellaneous

Announcing Windows 11 Insider Preview Build 22000.71 and Announcing Windows 10 Insider Preview Build 19044.1147 (21H2) and Releasing Windows 10 Build 19043.1147 (21H1) to Release Preview Channel (Brandon LeBlanc)

Introducing the next feature update to Windows 10: 21H2 (John Cable)

Valve have announced the very Switch-like Steam Deck (Katharine Castle)

How to opt-in to the Extended Stable release cycle option beginning with Microsoft Edge 94 (MS Edge Team)

Hands-On with the Office Visual Refresh (Paul Thurrott)

Microsoft reveals first Windows 365 pricing for PCs in the cloud (Tom Warren)

More Link Collections

The Morning Brew #3275 (Chris Alcock)

Collective #670 (Mary Lou)

Code Maze Weekly #85 (Vladimir Pecanac)

The Geek Shelf

 ASP.NET Core 5 and Angular: Full-stack web development with .NET 5 and Angular 11, 4th Ed (Valerio De Sanctis) – Referral Link

Flatlogic Admin Templates banner

PyCharm 2021.2 EAP 4 is out!

With PyCharm 2021.2 EAP 4, we’ve concentrated on small details and final bug fixes before the major PyCharm 2021.2 release. One of the improvements in this version is the ability to work with the SciView tool window when you are behind a proxy. The team also worked on improving support for literal collections.

Important! PyCharm EAP builds are not fully tested and might be unstable.

The Toolbox App is the easiest way to get the EAP builds and keep both your stable and EAP versions up to date. You can also manually download the EAP builds from our website.

DOWNLOAD PYCHARM 2021.2 EAP

Python 3.10: Pattern Matching

We are continuing to develop support for PEP 634 (Pattern Matching). In this EAP release, we’ve added smart code completion for the “match” and “case” keywords, to help you deal with pattern matching statements in the right way. Additionally, PyCharm can now complete “match” statements and their corresponding “case” blocks. Once you’re done typing an initial “match” statement, you can choose Complete Current Statement (⇧⌘⏎ ) and PyCharm will complete the remaining part, including the semicolon and the first part of the “case” block. The caret will be left in place for you to start typing the rest of the “case” block.

Literal collections

PyCharm’s type checker now can identify literal collections in expected types while comparing the expected and actual types for statements. This makes it possible to use collections of literals as actual types for the comparison, which means you can provide specific values for arguments. This works even for nested collections.

Notable bug fixes:

Data Science: the SciView tool window is now available when working from behind a proxy [PY-39763].
Debugger: enabling Jupyter Exception Breakpoint no longer leads to an error when debugging Python files [PY-34427].
Console: running a file in console no longer affects the Run/Debug configuration [PY-36063].
Python & Debug consoles: you can now use the Interrupt action (Ctrl + C) [PY-49021].
Community contribution: thanks to Xuan Wu, the test runner now recognizes testing method names in Unicode [PY-48747].

Ready to join the EAP?

Some ground rules

EAP builds are free to use and expire 30 days after the build date.
You can install an EAP build side by side with your stable PyCharm version.
These builds are not fully tested and can be unstable.
Your feedback is always welcome. Please use our issue tracker and make sure to mention your build version

How to download

Download this EAP from our website. Alternatively, you can use the JetBrains Toolbox App to stay up to date throughout the entire EAP. If you’re on Ubuntu 16.04 or later, you can use snap to get PyCharm EAP and stay up to date.

The PyCharm team

Flatlogic Admin Templates banner

Uszipcode: Best Module To Find Zip Codes in Python

The post Uszipcode: Best Module To Find Zip Codes in Python appeared first on Python Pool.

In Python, we can build many day-to-day use applications. These applications can either be GUI-based applications based on Tkinter or PyQt5 or Web applications based …

Read more

The post Uszipcode: Best Module To Find Zip Codes in Python appeared first on Python Pool.

Flatlogic Admin Templates banner