fabiochiu/medium-articles huggingface dataset:
Muck Rack and I Just Tusseled in Bed
By: Terry L. Cooper
Tags: Journalism, Publishers, Writer, Portfolio, Authors

Long pull on the cigarette.

Blows out smoke from mouth and nose — just like in the movies.

Ahhhh. That was good. Was it good for you? You seemed to be the ‘Little Engine That Could’ there a few times but in the end? Oh yeah. You definitely came through for me.

I said all of that to say this. I am now on Muck Rack. If there’s a specific article/story of mine you’re looking for, this will be the easiest way to find it. That is until, eh hem, Medium makes more changes.

Now I can finally get out of bed and actually adult some today! Thanks to Roz Warren for the idea.
Initial Impressions of UX folio
By: Daniel Mcardle
Tags: Portfolio, Ux Folio

So I’ve decided to explore other portfolio options besides Squarespace. One of my Flatiron cohort mentioned UXfolio as an option. I’ve since signed up and am in the process of feeling my way around the app:

First off their initial page is welcoming and positive. I like the upbeat tone and straightforward approach. It’s less intimidating than WebFlow, WordPress, or Flywheel (not that they are intentionally off-putting). UXFolio comes across as much more accessible, and seems easy to jump right in. Their explanations of the various options for templates and beginning case studies are far more intuitive and clearly explained, with little of the usual ‘flying blind’ feel other sites convey.

They also have a plethora of examples of their product in action, such as a gallery of ‘31 Impressive UX Portfolios’. This is quite helpful as it shows real world applications of the templates as opposed to, say, Squarespace. Sites like Squarespace tend to show amazing images and stunning photography that’s (understandably) tailored to the individual template design. But placing one’s own UI product shots or case studies in these templates is another thing entirely. UXfolio excels at showing users how their own work will look in a ‘real world’ setting.

So needless to say I’m going to give it a go and reconstruct my case studies in UXfolio and see how it looks with my UI and print work.
PortfolioMan — How-To. Treat this app like a broker!
By: Javanshir Alammadli
Tags: Portfolio, Investing, Portfolio Manager, Investment

Finally, we released our Portfolio Manager application. Here, we will go through some functions and share the best ways to use the app. This is the link if you haven’t downloaded it already:

https://play.google.com/store/apps/details?id=com.badraccoon.portfolioman

For a better experience and reporting, follow the steps as you would do it on a broker!

If you follow the steps in the beginning, it will become very trivial later on. First of all, you need to create a portfolio! Go to the Portfolios from the bottom navigation and click + to create a portfolio.

Name your portfolio and choose the right default currency. You can later add additional currencies.
Hello, and thank you for stopping by!
By: Zachary Immel
Tags: Portfolio, UX, User Experience, About Me

Hello, and thank you for stopping by!

My name is Zach, and I’m a Software-as-a-Service (SaaS) product designer based in Ohio; I also have experience in both educational and industrial technologies.

My journey into UX began during my undergraduate career in psychology. The more I learned about the human mind, the more fascinated I became with the expanding influence that technology has on our memories, our decision-making, our judgements, and our thought processes. Eager to learn more, I ventured into the digital sciences, and I’m more excited than ever to lead the way in designing a better world for our brains.
Publish Your Startup Cheap — Nginx
By: Eren Yatkin
Tags: Lets Encrypt, Startup, Portfolio, Nginx, Ubuntu

Hello folks, couple of days ago I published my portfolio online. During that time I realised that guides out there are outdated. So I decided to create one for myself and thought sharing with you would be nice.

So let’s get you up and running!

You can follow me on Twitter and Linkedin for more content like this.
My Art Portfolio, Carolina Ferrari
By: Carolina Ferrari
Tags: Art, Artist, Portfolio, Arte, Beaux Arts

(1) Reproductions

“The Birth of Venus, Zoomed” Colored pencils on paper. From January of 2020.

Inspired by Sandro Botticelli’s Birth of Venus.

As I researched Botticelli’s masterpiece, I found that “He (Botticelli) gave Venus an idealized face which is remarkably free of blemishes, and beautifully shaded her face to distinguish a lighter side and a more shaded side.”

With my reproduction, I was intrigued to see how an “idealized face which is remarkably free of blemishes” would translate when using the hard strokes of colored pencils.
Improving Your ETF Portfolio Strategy
By: Swissquote Education
Tags: Etf Investing, Asset Management, Investment, Portfolio, Etf

What looking inside your ETF “ingredients”? What are the drivers of returns and risks you want in your portfolio? How choosing the right tool and trading strategy?

“Improving Your ETF Portfolio Strategy” by Tariq Dennison is a webinar that would interest persons living in Switzerland, Europe and the Far East. It was organized by Swissquote, which frequently organizes webinars conducted by finance professionals for people using its online trading platform.

Most of these professionals are selected for their ability to help investors deepen their knowledge about specific markets, products, or advanced tools for trading. There is a particular focus on assisting investors in understanding the vocabulary, handling their favored trading platform, master investing tools, and increase their knowledge of the risks involved.

Tariq Dennison is a wealth manager, investment adviser, and financial planner licensed in both Hong Kong and the United States of America. He is currently running his own firm GFM Asset Management.

He has over two decades of experience of wealth management and holds a Master’s in Financial Engineering from the University of California at Berkeley; he has been teaching Fixed Income and Alternative Investments courses to masters’ students at the ESSEC Business School in Singapore.

Tariq’s passion lies in helping investors understand the investments they own and how high-quality assets generate and sustain income growth over decades.

The combination of two investor-oriented entities has made this webinar a very useful watch for investors who seriously want to improve their portfolio returns.his hourlong webinar is comprehensively designed towards helping the viewer understand all the multiple aspects of ETF investing. The webinar focused on cross border investments to maximize profits and educate the viewer about the modalities of cross country investments and how taxes and treaties can affect your net returns on investment.

Do something great with your portfolio

A unique and modern twist on the 60/40 ratio for portfolios is also shared. Tariq also shares how modifying investment strategy can maximize returns and gives an excellent insight into how to get all the information about an ETF based on your region and investment profile.

While we have done our best to summarize this information-packed hour into this article, to get the most of it, watch the entire webinar here:

Click on “Play” to watch the webinar

If you want to read on, the critical points of the webinar are mentioned below:

The Where covered the basics of cross-border ETF taxation, guiding investors regarding cross border taxations and how to avoid sending payments back and forth across borders.

Doing this would affect incomes due to taxes by the holding company’s country. If you do need to pick an ETF, pick one that is domiciled in a favorable treaty country. Viewers also got to know where to find the tax information.

“Three Bucket Timeline” Portfolio Model
6 Strategies to Make the New Profile Work for Us All
By: Desiree Driesenaar
Tags: Writing, Abundance, Strategy, Portfolio, Social Media

Many of my sister and fellow writers here have commented on the new profiles Medium gave us. I did the same when I was part of the beta group and thought I could have a little influence.

But no. Their mind was made up. And many of us don’t like the outcome. We’re lacking in skills to make the new profile work for us. So, let me shine some light on what I think Medium is trying to do (and they mean well for all of us, honestly!) and what they might consider instead.

And let me end with 2 tips on how to make the new profile work for us anyway if Medium does not change anything soon.

Dr Mehmet Yildiz wrote this story some days ago. With suggestions to Medium on how to change the design features with design thinking. There’s lots of truth in it.

I agree with the urgency to act. People are unhappy. They lack the skills to make the profile look nice. And I also think looking nice is not the issue here. Nobody will go to my profile just because it looks nice. We want one thing more than all others: browsing features.

We are writers. We are writing longer stories because we want to give nuance to our readers. We want to make emotional rants. We want to give our readers value with lots of background and a build-up of arguments.

If we were in the business of quick soundbites, we would just stick to Twitter. Medium is a unique platform for writers of longer stories and I love you for it! Our stories perform best when they are 1000–1500 words long. But we can elaborate and reach 2000 words when the matter we write about is complex.

So, what do I think happened? And how can we solve it?
All Your College Event At One Place
By: Ashutosh Navkar
Tags: Ui Ux Design, Case Study, Portfolio, Ux Case Study, App Design

Avent — A new event organizer

Brief

To help students enroll in college event/competition easily. (This project is limited to solving a problem for an individual college)

Project Process

I went through these processes to complete this project

Research > Alternative Design > Prototyping

My role

This was a personal project thus I worked on all the Research, UX, and UI designs

Time constraint : 1 week

Research

I researched in the following order

Naturalistic observation > Focus group > survey

What is the current way students

enroll in a college event?

There is a team of students who organize an event at colleges, events like Quiz Competition, Spell bee, etc.

And the main way students come to know about these events is through nominal advertising by the organizers. They advertise and give out information regarding event say date, time, and location of an event also students have to pay for these events to enroll in it via Cash, website, or mobile payment app

The current method of enrolling in a

college event is not efficient. Why?

The current method is very chaotic and hectic both for the students and the organizers. There is not a single organized place where you can find all the events and look for an event you like. Hence missing out on many opportunities. Notice boards used to be the best way but in fast-moving lives, nobody has time to look into notice boards anymore. And it has its limitations

Focus group

From the focus group, I learn the main problem students face is not knowing if the event is going to be good or does it even worth their time. I also learn that students want to go with someone

Survey

Here are the results of a small online survey I conducted with 12 participants
NPR Corporate Sponsorships — From My Pitch to Your Ears
By: Rowena Chang
Tags: Pitch Deck, Internships, Portfolio, Sponsorship, Ad Sales

A look at my final brand pitch to the NPR Corporate Sponsorships team.

Image credit: NPR.

Summer of 2019, I supported 12 Sales Reps and 2 Account Coordinators to bring the best sponsorships to our ever-growing radio and podcast audiences.

I worked on over 20 accounts, including Morgan Stanley, Google, National Geographic, Volvo, and Comcast. As a final project, I pitched a $1M new sponsorship opportunity to my team: New York Life Insurance.

Below are select slides from my custom pitch deck (not including ad spot copy, an overview of ad products, and placements proposal).
Cloning super investors as the investing strategy
By: Abhishek Rai
Tags: Personal Finance, Portfolio, Investing, Value Investing, Finance

(3) Cloning super investors as the investing strategy & how to do it?

Let’s start with the portfolio management process. In simple terms, managing a personal portfolio has four steps:

Idea generation: which companies to invest in?

Analyzing the firm: all the factors we discussed in part 1

Position-size: how much to invest in a firm?

Exit: when to sell?

As a retail investor, the biggest risk one runs is at the first stage itself i.e. picking the wrong companies i.e. companies with dishonest promoters.

Most retail investors do not have access to the network that can provide reliable information; they have day-jobs and do not have the bandwidth to monitor stocks on even a monthly basis (but still want to invest in stocks!).

How do you filter the businesses that are run by honest promoters or honest professional management?

Cloning super investors — How does it work?

One way to do that is by cloning super investors i.e. restrict your universe of businesses to a portfolio of very few investors who invest for the long term.

If a super investor whom you follow invests in company X, you also analyze it. If you also felt convinced then invest else pass.

It is important to understand that you also need to get convinced, else you will not have the conviction to hold when the 10x-stock goes up let’s 40%. Because you have not built your own thesis.

Further, let’s say you analyze a stock from portfolios of super investors and it turns out that you are not convinced then most likely it might be due to your own inability to understand something which the super investor understood. That’s alright! You don’t have to understand all the investing rationale of all the super investors. In investing, one is rewarded for being right and not for the number of bets taken. So, only act once in a while when you have conviction, else do nothing.

“All of humanity’s problems stem from man’s inability to sit quietly in a room alone — Blaise Pascal”

A case for cloning:

Mohnish Pabrai has widely advocated cloning as a strategy. Warren Buffett has admitted that his early success was a result of ‘coat-tailing’.

There are academic backing as well. As per the study, A hypothetical portfolio that mimics Berkshire’s investments created the month after they are publicly disclosed earns positive abnormal returns of 14.26% per year. Source
2D FALL SEMESTER PORTFOLIO (2020)
By: Samantha Smith
Tags: Art, Adobe Illustrator, Portfolio, Adobe Photoshop, Graphic Design

I am a freshman, majoring in design, at the University of Texas at Austin. As a way to end the semester with a BANG, I am showcasing my portfolio from my ‘Intro to 2D’ class. Continue reading to see a collection of various works that I have created this semester..

WORKING WITH SHAPES

In this assignment, we were asked to create a self-portrait using only shape, line, & color.

(Adobe Illustrator)

MANIPULATING PATHS

Using exactly 50 lines, we were asked to create a composition that encourages eye movement.

(Adobe Illustrator)

PATTERNING WITH PURPOSE

In this assignment, we were asked to create a pattern using the following elements of visual weight: foreground, background, & detail.

(Adobe Illustrator)

CONSIDERING COLOR

Considering how color can alter & elicit emotional responses, we were asked to create a composition of 10 images, each using the same base-image (that we designed ourselves). Through each one, we chose a mood we wished to convey & worked with a chosen correlating color pallette.

(Adobe Illustrator)

Do any of these give off my mood of choice?
ACLU Social Content & Analytics
By: Rowena Chang
Tags: Content Strategy, Internships, Portfolio, Social Media, Tiktok App

TikTok Strategy

As the resident Gen Zer on my team, I spearheaded the new TikTok account by pitching, drafting, and posting the first 15 videos, accumulating 100K impressions in 1 month. I monitored trends and evergreen TikTok formats to shape our brand voice on an emerging platform.

Check out some of our latest TikToks!
[Defi : Donnie Finance] Introducing the first integrated financial service platform
Tags: Banking, Defi, Credit, Portfolio, Finance

Save, Check, Invest, Borrow, and Leverage the Cryptoccurrency with Fully Decentralized Bank
Top platforms to host your portfolio today
Tags: User Research, WordPress, UX, Portfolio, User Experience

WordPress

So one of the most popular platforms out there is WordPress. WordPress is a popular content management system that powers many sites on the web today, big and small.

The nice thing about WordPress is there is nearly a plugin for everything because it’s been around for almost two decades at this point. This means you can make it your own and customize it the way you want to.

However, the interface isn’t straightforward to modify and customize unless you have some basic code knowledge.

Their editor can be pretty clunky, and the backend interface can take some time getting used to as well. If you’re going to use WordPress, you likely have to choose one or more themes or plugins to power your website.

Some plugins are more powerful and allow you the flexibility to build your site, however you want.

Divi, Elementor, Semplice, and WP Bakery are examples of some of these. The initial setup can be a bit of a headache, but once you get used to the platform, you’ll be able to change and add new pages in no time.

My Rating:

I’ll give WordPress a 2.5 out of 5 in terms of ease of use, 4 out of 5 for customization unless you’re using a particular premade theme, in which case that can vary depending on which theme you’re deciding to purchase. And I’ll give it a 4 out of 5 for price.

Again, this depends on which theme you decide to buy. Some themes are free, while others are more expensive. You get what you pay for, but ultimately, using WordPress, you can build a pretty good portfolio without blowing the bank.
5-steps to making a free personal or eCommerce website today
By: Mark Vainauskas
Tags: WordPress, Ecommerce, Portfolio, Entrepreneurship, Business

Step 1: Sign up for Hosting

Hosting cost money, it cost money to store your website data. There is this wonderful thing called google, they make it practically free. Google has their very own cloud platform, GCP. So we’re gonna use that for our hosting. Let’s head over to: https://cloud.google.com/

GCP homepage

If you haven’t already, login into your google account. If you don’t have one you’re gonna need to create one. Once you clicked the blue button “Get started for free”. You will then be prompted to agree to the terms of service and select your country. Then your information name, address and credit card info. Don’t worry there is no charge and even if the trial ends it still won’t charge you.

Step 2: Set-up Hosting

If you made it this far congratulations! Let’s keep going! You should be at the homepage.

Homepage

Now let’s create a new project. The blue bar at the top where it says, “My first project”. Then click “new project” in the dialog window. From there you should get this.

Creating new project

Call it whatever you like but I’m gonna call it “ecommerceSite” then click create. Give a min to set up. Once it’s done, make sure you select your project in the blue bar to the one we just set up.

ecommerceSite project selected

Let’s head over to marketplace from your navigation menu, appearing to your left when you click those 3 bars at the top left of the homepage. In the marketplace search for “wordpress certified by bitnami”.
Affinity Diagram key of problem solving
By: Umair Jeelani
Tags: Affinity Diagrams, UI, Flatiron School, Portfolio, UX

The affinity diagram is a tool commonly used within project management and allows large numbers of ideas stemming from brainstorming to be sorted into groups. It is a very useful tool to bring all our ideas together and organize it in a professional way. The sticky notes can include various information such as: data from user testing, user insights, design issues etc. As a UX/UI designer, one might use affinity diagrams when they are working on a project that seems overwhelming. It can help get a group consensus on large issues and help create, design and consolidate information effectively. It showed me what I need to add to my product to make it the most useful for the user and make it an all-encompassing app to provide a satisfactory user experience.

These are few steps for affinity diagram process:

1 While brainstorming record your ideas on sticky notes or cards so you can gather large amount of data or ideas.

2 If the ideas are related to the project and you think it will fit in your project, then put it on the other side so you can implement it later.

3 Discuss ideas with your team mate and make the groups and subgroups to increase the data and organize mannerly.

4 Filter your ideas to make the process faster and more organized.

Here is one of my project example of affinity diagram using Miro which is a very valuable tool for affinity diagram.
From 0 to 1: make a simple portfolio with CSS Flexbox
By: Dusing Chang
Tags: CSS, Front End Development, Portfolio, Gallery, HTML

Flexbox has been wildly in making image gird, masonry layout and responsive design. This article provides three different usage of Flexbox. The final demo is a two-column portfolio without header and footer. If you have no ideas what Flexbox is, you can read this article for a better understanding of Flexbox later.

Here is the demo, and then let us start from the beginning.

At first, I used AdobeXd to make a draft layout. This is just the very first design for my personal portfolio, therefore it is not necessary to

create a fancy design here. I suppose that anyone who gets this template can add new features by themselves.

Step 1: Global layout

.html file

When using Flexbox, there must be a container being outside the layout.

I then, divided the layout into two-piece with <div>.

.css file

We initiate Flexbox with ‘ display: flex;’ statement and set the direction to being horizontal.

statement and set the direction to being horizontal. So the images will be presented from left to right, moreover, ‘wrap’ means the elements are arranged in the same direction(left to right or top to down).

flex-basis is used to set the length of items. You can also type in “px”, “em” or any other length units allowed by the browser.

Step 2: Image grid

The image layout I used is based on Adaptive Photo Layout with Flexbox by Tim Van Damme.

Here I mention two points about my modification:

Tim uses the ‘flex’ properties(as a shorthand) which I think it is too confusing for people who are not familiar with Flexbox.

For preventing the uncontrolled problem, he added an empty <li> at the end of his layout. I deleted this line of code in my design.

.html file

.css file

We already declared the ‘display: flex;’ in the flex container outside. Why we have to do that again?

Well, the browser only applies the first layer inside the container as a Flexbox. So if you want to set other layers’ elements to present Flexbox properties, you have to add ‘display: flex;’ again.

flex-grow set all images(the <li> items) to fill(or grow) the space. Here we set the value in all <li> equal to 1, which means the remaining space is given to all children.

Step 3: Responsive design

Our last step is to set up a mobile layout. Before we do anything for the container class which is outside the image grid and sidebar, the mobile layout is a mess.

We now need only one column, so the direction of Flexbox should be vertical.

We need to add a slice piece of code inside the @media:

.css file

We set flex-direction to column(vertically)

The browser will stack the flex items from top to bottom

Now, it looks right!

BTW, if you do not know, here is the way to remove remaining space:
Social Media for…Yogurt?
By: Connor Blacksher
Tags: Design, Content Strategy, Design Thinking, Portfolio

Credits

Content Manager: Ada Walton

Designers: Connor Blacksher, Joe Aliotto, Andi Fink

Writer: Joe Bozic

Yogurt Operating Unit aka YOU

This all started with a contract to work on the social media team at General Mills. “Connor wait, General Mills is huge, you didn’t work on the corporate social team.” Good clarification. I was specifically on the social team for Family Favorites (the cone shaped yogurt), Go-GURT, and Oui. As a result of working on such diverse brands, I was able to have a ton of fun experimenting with how each one would play. It was also extremely helpful to have a fridge full of these yogurts on the floor for sampling and snacking on.

Go-GURT Bay Bee

Launching with the cutest lil’ grid post.

Everyone has a connection with Go-GURT. If you don’t then like, I get it your parents were super cool and hyper vigilant about your sugar intake. For me it was one of those “holy moley” moments. My silly face is working on the social channel for Go-GURT?! It was a freakin trip if we’re being fully honest. What was even wilder was the first pitch/project we were working on was the social roll out for SOUR PATCH KIDS GO-GURT.

After getting over the initial “holy shizz” of realizing that I get to play with Sour Patch Kids & Go-GURT, it was time to get crunching. One of the big things that stuck with Joe and I from the SPK brand guide was the emphasis on “sour, and then sweet”. They’re goofy cute lil kids. So let’s play with that. One of the first “aha” moments was to have one of the kids pop in and take over the profile picture. After that we started thinking of different environments that they kids would be interacting with Go-GURT in.
Imam Uddin | imamuddinwp | vCard
By: Imam Uddin
Tags: Web Design, Digital, Social Media Marketing, Portfolio, Digital Marketing

Hey there, it’s me! Imam Uddin, also known as ‘imamuddinwp’ by google & other search engines. Here I have published a vCard on about details of mine.

Imam Uddin | imamuddinwp | vCard

It’s just a simple vCard of Imam Uddin, imamuddinwp. To see it live: Imam Uddin | vCard

vCard | Imam Uddin | imamuddinwp

Thanx for reading this small post.

With thanks & love 🍹 🍹…✍️

Imam Uddin

imamuddinwp
Style Tiles versus Moodboards
By: Umair Jeelani
Tags: Style Tile, UI, Flatiron School, Portfolio, UX

Let’s start with the question why do we do style tiles, and how are they helpful in thinking through your design direction?

Style Tiles are important because before creating a high fidelity prototype which takes time we can create multiple style tiles to show the client different visuals which includes color palette, typography, hierarchy showing headings & body, iconography and images. These are able to give the client a feeling of how the final brand would look and feel like. It gives them a sense of visual direction they want to move forward with.

The vital thing to consider about style tiles is that they are not an exact picture of how the site will look; instead, they help define the mood, tone and feeling of a site.

Moodboards and style tiles are not the same. Style tiles are one step ahead from moodboards. Moodboards gives you general idea or feeling about a specific theme. But style tiles express more details in terms of user interface elements, layout, and its overall feel, so the designer and the stake holder knows which design direction they are heading in so they don’t start over design again and again. As a designer we should give at least 3 style tiles as options to the client so they can decide on their preferable design direction. Also, it’s ok if they like some components from one and some from the other style tiles because then you can create a final style tile to present to the clients for final approval.

Challenges of style Tiles

Normally, when we design style tiles the users or stakeholders think it’s a website page, template or layouts. Explaining the style tiles may be bit difficult but if the users or client understands it then they get more excited for the next stage of the design because the more involvement or constructive feedback you get the better design you will achieve with faster approach.

Here are some of my style tiles examples below:
La estúpida obligación de tener un portfolio
By: Francesco Maria Furno
Tags: Personal Branding, Portfolio, Job Hunting, Branding, Creativity

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
How to reduce duplicated code by using dependency injection in Angular
By: Pham Huu Hien
Tags: Angular, Dependency Injetion, Clean Code

In my current project, there’s a block of code that is used in many places. The code looks like this

@Component({

...

})

export class SomeComponent implements OnInit {

constructor(

private route: ActivatedRoute

) {} ngOnInit(): void {

this.route.params.pipe(

takeUntil(this.destroy$),

map(params => params.id),

filter(v => !!v),

// do something with this id

);

}

}

The above code gets a stream of id from the activated route. In other places, it would be getting the passengerId from activated route, or getting whatever id and do something with it.

So the pattern is that using the ActivatedRoute service to get something from the route parameters.

In fact, we can reduce this duplicated logic by using dependency injection. Here’s 3 steps to do that.

Declare injection token and factory function

First, we create a file named route-param.token.ts in a folder, for example core/tokens

export const ROUTE_PARAM_TOKEN = new InjectionToken<Observable<string>>(

'Stream of route param from activated route'

); // if you want to get :id from route, declare this token

export const PARAM_KEY_ID = new InjectionToken<string>(

'static string for :id param key',

// this is the second argument of InjectionToken constructor

// to produce the value, like when you use useFactory

{

factory: () => {

return 'id';

}

}

); // if you want to get :someId from the route, the token should look like this

export const PARAM_KEY_SOME_ID = new InjectionToken<string>(

'static string for :someId param key', {

factory: () => {

return 'someId';

}

}

); export function routeParamFactory(

route: ActivatedRoute,

paramKey: string

): Observable<string> {

// should use paramMap because route.params will be deprecated soon

return route.paramMap.pipe(map((param) => param.get(paramKey)))

}

Declare the token in the provider list of your component

Next is to declare the token you want to use in the providers list in your component.

@Component({

providers: [

{

provide: ROUTE_PARAM_TOKEN,

useFactory: routeParamFactory,

deps: [ActivatedRoute, PARAM_KEY_ID]

// if you want to get someId, the deps will be

// deps: [ActivatedRoute, PARAM_KEY_SOME_ID]

}

]

})

export class SomeComponent {

constructor() {}

}

Inject the token in constructor and use it in your component

@Component({

providers: [

{

provide: ROUTE_PARAM_TOKEN,

useFactory: routeParamFactory,

deps: [ActivatedRoute, PARAM_KEY_ID]

}

]

})

export class SomeComponent implements Oninit {

constructor(

@Inject(ROUTE_PARAM_TOKEN)

private readonly id$: Observable<string> // should use readonly as much as possible

) {} ngOnInit(): void {

this.id$.pipe(

// do whatever with this id

);

}

}

There are many benefits when you use this approach

It makes your code cleaner and easy to understand and maintain

Easier to test you component by mocking the dependency injection token

It helps reduce duplicated logic in your code

Thanks for reading.
Clean your Code with Encapsulation
By: Oliver Pham
Tags: Coding, Computer Science, Clean Code, Software Development, Programming

Clean your Code with Encapsulation

I recently realized that one concept seems to transcend multiple programming paradigms: encapsulation. Logic and data can be encapsulated in variables, functions, classes, and modules/packages. How can we take advantage of this concept to organize our code?

Photo by AltumCode on Unsplash

Duplicate Code

Once in a while, when I find myself hitting Ctrl + C while coding, I can’t help feeling that I’m doing something irredeemable.

Copying others’ code without thorough understanding of what it does is definitely a bad practice, but copying my own code also raises my fear of a malevolent entity: duplicate code. The act of duplicating my code is analogous to that of putting my keys anywhere except the usual spot. Every time I do that, I have to ransack my whole house just to find my key. Similarly, if my duplicated code is flawed, I have to frustratedly search for the duplicates in my gigantic codebase and change each one of them.

How can we avoid this? Simply turn them into reusable components using structures supported by your programming languages to encapsulate them. Afterwards, you can reference them whenever you need.

Volatile Compounds

If you are building projects that have constantly changing requirements, you’d preferring making as few changes as possible to your code. Encapsulation can help you achieve this.

For instance, I have this function that implements Backtracking to solve the N-Queens problem:

Can you guess what the program does inside the loop right away?

What if I need to log the positions of each queen after placing a new one? I’d have to study my code and locate where I should add the new code.

Let’s apply some encapsulation by wrapping unrelated code inside functions:

Encapsulate any irrelevant implementations that are open to modifications

Now, I can easily add a function to log the positions of the queens inside the placeQueen() function. Whenever I need to alter any steps in the backtrack() function, I just need to locate the involved function and make any changes to only it.

Black Magic

Since time immemorial, black magic has been known to be practiced by those who can manipulate supernatural powers to serve their selfish desires. It appears in various forms. They range from the spell that my mom always uses to conjure my lost pair of socks to the magical compiler that compiles my code successfully at first attempt (I’m joking). Nevertheless, all of them share the negligence of human ethics at their core. During my time as an apprentice coder, I’ve encountered one evil form of them that is powerful enough to baffle even the experienced coders: lengthy, complex expressions.

How long does it take you to understand the condition?

“Only peasants don’t understand such beautiful expressions!”, you may argue. It’s fine to do that if those who maintain or debug your code are coding wizards. If that’s the case, you can kindly ignore this tip. Otherwise, I’d like to present a way to improve readability:

Is it less demoralizing to read it now?
Clean architecture en Flutter
By: Alfredo Bautista Santos
Tags: Dart, Testing, Flutter, Clean Code, Clean Architecture

Sysadmin and web developer. Co-organizer of GDGMarbella & FlutterConf in Marbella, Spain. Flutter enthusiastic.
The primary goal should and must be readability and maintainability!
By: Thomas Zuberbühler
Tags: Clean Code

The primary goal should and must be readability and maintainability! Shorthands should not be used all the time, it’s should be used when it makes sense and improves readability. This comes with experience. The decision should not be made based on saving time or code lines!

My favourite quote Martin Fowler: «Any fool can write code that a computer can understand. Good programmers write code that humans can understand.»
The most important techniques that any developer must use to write a clean Code
By: Hussam Barbour
Tags: Clean Code

As a developer it is most likely that you will work with a team on certain projects, so you are not the only one who is viewing your code and it is very important to keep it clean and understandable.

In this article, I will list the most important techniques that you should understand and follow to write a clean code that everyone can understand.

1. Do not complicate your code and make it as simple as possible. A common issue between most developers is that they write a very complicated code instead of trying to write a clean one while they are working on a certain problem. By keeping the code simple, you can solve problems faster.

2. Make sure that you use Comments whenever needed. That will help you a lot in debugging and analyzing your code in an efficient way. Also, it will be much easier for your colleagues who are working on the project with you to understand the code.

3. Avoid duplication to have a clean code instead of unnecessary repetitions which can make the code very difficult to understand, analysis and debug.

4. Ordering the code and using indentation is very important when it comes to reading the code as it will make it more readable and easier to understand.

5. Make sure to have a proper naming convention as it is very important while you are coding. When you follow a correct naming convention and not creating irrelevant or contradicting names to pages, variables and functions, you will avoid creating trouble for yourself in the future.

Finally, as a developer you should always think about solving the problems instead of just simply copying the code from other sources. You must regularly practice writing the code yourself.
Avoid unnecessary function indirection
By: Afiz Momin
Tags: Function, Clean Code, First Class Function, JavaScript

When a function calls two or more functions and processes each output before sending it over to the next, essentially you are composing logic. When a complex logic becomes difficult to manage and read, one may choose to break it down into smaller functions and call them from the main function. I have seen in the code base of the developers where a function merely does little to nothing before calling the function and returning an output. Makes me wonder is there a need for a function accepting arguments and merely passing to another function?

Why would a person do something like that? Is there a real advantage?

Let’s take a look at an example of function indirection. Suppose we want to render products with categories on the page and display the first name of a user. We created the helper functions that return the needed information to render on the page. To achieve this, we are directing our execution of logic and the reading order from the OnPageLoad function to these helper functions. Each of the function is just a wrapper doing as little as preprocessing the input and returning the response. Do we at all need them?

We don’t. So how we can improve our code so that while reading the flow of execution a reader does not have to jump between the lines in the modules and keep scrolling up and down forcing us to spend time on a worthless exercise.

So what are we missing here? It is not treating a function as a first-class citizen of the language is the actual problem here. Not all the language support functions as first-class, but Javascript does.

What does a first-class citizen mean? Is there a second-class citizen? Nah, it is just a metaphor.

A function in Javascript is an object and when it is assigned to a variable, the variable carries the reference to wherever it is passed or could be invoked later, did you forgot callbacks? When you have an opportunity to make the codebase readable and light you should. The more the lines of code, the more is the surface area for the bugs. Keep in mind!

As you can see the equivalent line of code below each function shows how to treat functions as first-class citizens which removes unnecessary indirection. After this refactoring, do you need these helper functions at all? You don’t unless you want to rename the function name. The implementation in OnPageLoad doesn’t change at all.
Nice article, I like way you are creating a naming scheme.
By: Helge Fahlbusch
Tags: Clean Code, Naming Conventions

Nice article, I like way you are creating a naming scheme. For the boolean stuff most of the time I stuck to ‘is’ and I was feeling bad using some other ‘prefix’ like ‘has’. I also did the ‘bad’ thing with ‘exists’ and was never totally satisfied with the naming. Thanks for the tipp with ‘has’ which reads much better.

For me the ‘boolean’ prefixes should always read like a question and the boolean is the answer..like an inner dialog.

I am not totally happy with the term ‘prefix’ as it only states the position of this part, but not the content or type of word that is used.

Do you think that there exists a more meaningful term for words like ‘is’, ‘has’ or ‘should’?
Clarity or Optimization which should come first for naming a variable or function?
By: Monayem Islam
Tags: Coding, Programming Tips, Coding Mistakes, Clean Code, Programming

You are a novice programmer and think that variables and functions name couldn’t meet the standard. Every beginner makes some silly mistakes in variable and function names which I also did. In this article, I am going to share with you some tips that helped me to level up my coding skill and enhance my confidence. Before start I want to recall the boy scout rule which is too much relatable with our best coding practices.

Leave the campground cleaner than you found it.

Ignore Nonsensical variable and function names

If you think you are naming the variables and functions only for machines then it doesn’t matter what you are giving its name. But If you think your code should be human readable then you have to be conscious about variable and function names. For example,

Code 1:

double h = 7.9;

double w = 5.8; public double a(double h, double w)

{

return h * w;

}

Code 2:

double height = 7.9;

double width = 5.8; public double areaRectangle(double length, double width)

{

return length * width;

}

Code 1 will work perfectly but it’s quite difficult to understand what’s happening here. Without putting comment it’s quite impossible to understand the meaning of h and w.

double h = 7.9;

//h stands for Rectangle height double w = 5.8;

//w stands for Rectangle width

But a variable requiring comment means the variable name doesn’t reveal its purpose.

On the other hand if you look at Code 2, easily anyone can say that it’s calculating the area of a rectangle where the height and width of the rectangle is assigned. This is the benefit of good naming convention. There are some delimiting conventions for multi word variables such as Snakecase, camelCase. Personally I prefer camelCase.

Now you are thinking that descriptive variable or function names should increase the size of code but it’s ignorable because a descriptive name helps other programmers to understand your code. Even you couldn’t understand your code after a year without descriptive names.

Tim Ottinger says that
What clean means and why you should care
By: Jessica Veit
Tags: Clean Code, Software Development, Motivation

What clean means and why you should care

Clearly there are things that are overused in the software industry. Some of them even impact the world beyond the development office. The innocent term clean is one of them. Regardless of whoever bugs you about it — let us forget about them and embrace the power of clean together. Jessica Veit Dec 22, 2020·3 min read

Clean is a term that gets thrown around in the software development industry like null pointer exceptions. We read and hear everything about clean code(r), clean architecture and whatever other stuff that may or may not be clean in one way or another. Even project managers love to pick on us developers while rambling about the importance of this topic, often not being equipped with any coding experience or knowledge about it whatsoever.

So, it seems that over time many developers got desensitized to truly caring about these concepts which were meant to give structure and a sense of ease in our craftsmanship software development. Now let us take a step back together. Forget about the times this simple, silly word nearly made you lose your marbles and look at what it can truly do for us.

The main Benefits of Clean

As with everything a good amount of motivation makes things a lot easier. The main benefits of working clean are pretty obvious if you thought about it once.

Easier to Test (more spaghetti for your dinner plate)

Bugs are (more) obvious (again less spaghetti chaos in your code and problems sometimes just kind of resolve themselves)

Lower maintenance burden (because there are less bugs to fix and customers to calm down)

Less communication between developers needed (communication is key but let us use that time for more important topics)

And the list goes on. But you may already see a trend going in the direction of “If you do it right, you only have to do it once.”

Clean Code — everyone starts small

The devil is in the detail, so first focus on that one. Thinking of the actual essence of software brings us to the code itself. But let us not dive into classes just yet, what are characteristics your ideal code should have? What special kind of spice was in the last snippet you really liked just because of how it looked? Probably at least one of those features grabbed your attention:

The code was documented, but not polluted by comments

Names of variables and function seemed reasonable (not too long and not too short)

The code was not nested in some (nasty) way

Functions (if present) fit on your screen (without zooming out)

Calls were not overflowing with parameters

Did you see your snippet? All these rather small things make a difference concerning the general appearance of your code. And guess what, with just those thoughts in mind, your code base will already make a huge step in the right direction.

Clean, simple, and smart.

Ps. I highly recommend all books written by Robert C. Martin if you are interested in cleaner code and a simpler developer life.
👏 Stop 👏 Messing 👏 with 👏 TSConfig
By: 𝐁𝐚𝐲𝐚𝐧 𝐁𝐞𝐧𝐧𝐞𝐭𝐭
Tags: Tsconfig, DevOps, Typescript, Best Practices, Clean Code

After finally figuring out the cause of all the error messages, I thought, “ESLint has eslint:recommended and @typescript-eslint/recommended , there must be a recommended tsconfig out there." Lo and behold such a library exists to save us from the perdition of configuration, and it's called @tsconfig/bases .

Created on 13 May 2020, @tsconfig/bases provides base tsconfig.json files for new and old projects alike. Their purpose is to provide developers with a good base configuration. Most projects don't need the full configurability that TSConfig files offer.

Is this necessary to use one of the @tsconfig/bases ? No. Will it increase consistency across projects? Yes.

Installation

As of writing this post, 8 templates are provided:

deno

docusaurus v2

node10

node12

node14

react-native

recommended

svelte

Each can be installed via npm / yarn , where $TEMPLATE is replaced by one of the names listed above.

For example: npm install --save-dev @tsconfig/recommended

My Most Common TSConfig

…That’s it…

I can set it and forget it. When I revisit a tsconfig.json file in a different project, I can quickly see what's different. Usually, the difference is just a few extra keys in compilerOptions . Quick and painless.

Here’s what @tsconfig/recommended/tsconfig.json looks like:

Any of the config options in your file will be preferred to what’s in @tsconfig/recommended/tsconfig.json . So if any of the recommended options are causing issues (most likely strict ), you can override them in your config.

A " strict" R eminder

strict turns on all of TypeScript's strict settings:

alwaysStrict

noImplicitAny

noImplicitThis

strictBindCallApply

strictFunctionTypes

strictNullChecks

strictPropertyInitialization

TL;DR