Post image
Strategy

Need help with SSl : webdev


my domains seem to be verified just fine but in order to get it secure in the browser I need to manually add the https before the domain. I also get a locked browser if I just do tutorswapp.com (removed the www).If I just type tutorswap.com into the search bar I get the www. that is not secure. Its a mess, all help is greatly appreciated, heres some screenshots:

Post image

in heroku settings

Post image

domain.com dns settings (think this is where the issue is) all help is greatly appreciated!)



Source link

Generated quote
Strategy

How We Use PHP to Generate Instagram Images


Unlike most people’s Instagram, our Instagram is almost 100% automatic. For example, we use code to generate our images.

Why Automatic Images

On our website, we interview people who do great in fitness. Most of the interviews have great, motivating quotes that people in fitness love, so, inspired by Foundr’s Instagram, it was kind of obvious that our Instagram images should also be quotes.

All our interviews have a personalized avatar attached to them, so we decided to also add the avatar and the name of the person behind the quote to each image.

Getting the Quotes

In our interviews, the quotes are shown using a WordPress shortcode (since our site runs on WP). Like this: 

[quote]I once did 5,500 burpees in 24 hours.[/quote]

The shortcode above leads to this being generated on the page (live here):

Generated quote

When the shortcode is run, the quote is saved to a custom table in the database (wp_[prefix]_quotes). Once a week, an editor take a look at any new quotes and mark the ones that might do well on Instagram.

Putting the Images Together

First, we create a base image, which is just a white image with the right dimensions. In our case, that’s 600 x 600 since that resolution is good enough for Instagram and square-like Instagram likes.

We then set up the colors for the texts:

Adding the text to the images is done using imagettftext(). That function takes a lot of parameters and it’s no secret that we tried many different positions and font sizes before the text ended up looking perfect on the images (especially because the names and quotes all have different lengths). 

We add one line at a time to the image using imagettftext(). Like this:

The avatar image we add using  imagecopyresampled(). Like this: 

The parameters  $avatar_size is the size of the avatar image — and since our avatar images are square, we can use the same parameter twice.

Finally, we add our logo. Smart readers might have spotted the two orange “//” in our logo could be text — and yes, that’s what it is. 2 x 3 “/” characters placed very close to each other with  imagettftext():

After the logo has been added, we just need to save the image and drop the temporary image we have been working on:

Other temporary images must also be destroyed, like  imagedestroy($avatar_image_portrait);.



Source link

Creating a new ASP.NET project
Strategy

How To Use Async Pipe in Angular 8


Introduction 

In this article, we are going to learn how to use an Async Pipe in Angular applications. 

What Is Async Pipe?

Async Pipe is an impure pipe that automatically subscribes to an observable to emit the latest values. It not only subscribes to an observable, but it also subscribes to a promise and calls the then method. When the components get destroyed, it automatically unsubscribes them to reduce memory leaks.

Advantages of Async Pipe

  1. Async Pipe makes the rendering of data from observable and promise easier.
  2. For promises, it automatically calls the then method.
  3. For observables, it automatically calls subscribe and unsubscribe.

Prerequisites

  • Basic knowledge of Angular.
  • Visual Studio Code must be installed.
  • Angular CLI must be installed.
  • Node JS must be installed.

Step 1

Let’s create a new Angular project, using the following NPM command:

 

Step 2

Now, let’s create a new component by using the following command:

 

Step 3

Now, open the async-pipe-example.component.html file and add the following code in the file:

Here, in the following code, we can see how to apply async pipe with our structural directive, *ngFor.

Step 4

Now, open the async-pipe-example.component.ts file and add the following code in the file:

Here, in the following code, we are using observables of any type. To get the asynchronous flow data, we can use the subscribe method to subscribe to the observables, or we can simply use async pipe, which automatically subscribes to an observable and returns the latest value. It also unsubscribes automatically to avoid memory leaks.

Step 5

Now, open the product.service.ts file and add the following code:

Web API: Create an ASP.NET Application

Follow these steps to create an ASP.NET application. 

Step 1

In Visual Studio 2019, click on File -> New -> Project.

Creating a new ASP.NET project
Creating a new ASP.NET project

Step 2

Choose the Create option and select ASP.NET web application.

Creating a new ASP.NET application
Creating a new ASP.NET app

Step 3

Select Web API and click OK.

Creating Web API
Adding Web API

Step 4

Now, right-click on the controller and then add a new item. 

Adding a new item
Adding a new item

Step 5

Choose Ado.net Entity Data Model and then click on Add

Creating a new data model
Creating a new data model

Step 6

The next step focuses on the EF Designer. Just click on Next

Selecting EF Designer
Selecting EF Designer

Step 7

 A new pop-up will show. Click on Next. If yours isn’t established, then click on New Connection.

Choosing connection
Choosing connection

Step 8

Copy your database connection server name and paste it in the server name textbox. You will see all the databases. Select your database and click on OK.

Selecting correct database
Selecting correct database

Step 9

The next popup will show. Paste your database server name, choose the database, and test for the connection. Then, click Next. Here, in the new screen, select your tables and store the procedure. Then, click on Finish

Choosing database objects and store
Choosing database objects and store

Our next step is to right-click on the controllers folder, and add a new controller. Name it as “Product controller” and add the following namespace in the student controller.

Here is the complete code for getting all the product data and their nested product information data. 

Complete Product controller code

Now, it’s time to enable CORS. Go to Tools, open NuGet Package Manager, search for CORS, and install the “Microsoft.Asp.Net.WebApi.Cors” package. 

If you are running your frontend application in a different port and your server is running in another port, then to avoid a Cross-Origin-Resource-Sharing issue you have to add small code in webapiconfig.cs file.

Open Webapiconfig.cs and add the following lines.

Backend

Here, we will do back end related code using SQL Server. The very first step is to create a database.

Create Database

Let’s create a database on your local SQL Server. I hope you have installed SQL Server 2017 on your machine (you can use SQL Server 2008, 2012, or 2016, as well). 

Step 1

Create a database product:

Step 2

Create a product table using the following code:

Make product ID the primary key. Now, it’s time to add some store procedures.

Step 4

All you have to do is paste the following code in a new query:

With this step, we have successfully completed our frontend, web API, and backend coding. Now, it’s time to run the project by using npm start or  ng serve and check the output.

Conclusion

In this article, we have learned how to use an Async Pipe in Angular 8 Application. 

Please give your valuable feedback/comments/questions about this article. Please let me know if you liked and understood this article and how I could improve it.



Source link

why is this happening??????
Strategy

why is this happening??????


why is this happening??????

I want the shapes to be any color I want. The tool bar with the 3 slashes in it will only let me make them black and white./ WHY. I cant get it off the screen

https://preview.redd.it/mg063k4w80u41.png?width=1840&format=png&auto=webp&s=7150c5dc328f6b08f9258c45934f28ecb8b41383

submitted by /u/scottsedy
[comments]



Source link

AMD vs CommonJS
Strategy

JavaScript Module System – DZone Web Dev


Separate and Abstract code in its own scope, making it accessible and included again!

That’s the thing that JavaScript module systems help us to achieve. JavaScript applications tend to grow fast and without any kind of structure in place. It is often very difficult to keep a clean code-base in larger JavaScript applications. Traditionally, different techniques, like IIFE, Revealing Module Pattern, etc. are used to achieve modularity in the beginning, but as application complexity grows, more sophisticated systems are required, and various module systems are available for us to use. 

This post will provide an introduction for these module systems, and in future posts, we will be building on top of this knowledge. In this post, I will describe what JavaScript modules are, why we need those, and what the benefits of using those module systems ar.

If you are a C# developer or a Java developer, we normally break down our code in different classes/files and then import those classes/files to another class (e.g. via a using statement in C#), and with that, the functionality is available in other classes to be used.

This way, we can structure and organize our code in a cleaner manner. This also promotes reusability, separation of concerns, etc.

JavaScript module system allows us to do the same thing for JavaScript. The module system allows us to separate code in different blocks (modules) and make it available in other parts of the application.
In JavaScript, there are different formats and ways to accomplish this challenge to separate and abstract code in its own scope, making it accessible and included again.

Module System Depending on Environment

JavaScript can be executed in many places, to start with, in the browser (for web UI ) and Node (for back-end services).

  • Depending on the environment you are in (in a browser, or in a Node application) modules can and have to be written in many different systems, so that it can be used in many different environments.
  • Each module system describes a different format in a way that code separation can be created (CommonJs, AMD, ESM).

Module Formats vs Loaders

  • Module format is really just the syntax used to define the module. Module Format -> Syntax.
  • However, the syntax is useless without something that understands how to execute it. That’s the role Module Loader plays. They are usually JavaScript Libraries that you can include in your project.
  • Using a particular module-format will also require a compatible module-loader. Not all module loaders support all module formats.

AMD vs ComonJS vs ESM

AMD and CommonJS are the popular module formats, and the following details describe their general characteristics, However, the one which we are interested in is ECMAScript modules, and we will use it in conjunction with TypeScript. For AMD and CommonJS, you can search online for details; I just mentioned those here because you will most likely read about those in various other blog posts or articles.

AMD vs CommonJS

Here is a code example of writing a basic module in typescript and then consuming this module in another module.

Creating and consuming module in TypeScript

So, this was the introduction to the JavaScript module system. As I mentioned before, our focus in the upcoming posts will mostly involve typescript, so I will suggest that you visit http://www.typescriptlang.org/ to understand more about it. 

Also, the TypeScript website will show you how to set up your development environment and some basic examples as well. In the next post, we will be starting our journey from this point onward. Happy Coding.



Source link

Creating Playful Effects With CSS Text Shadows
Strategy

Creating Playful Effects With CSS Text Shadows


Let’s have a look at how we can use the CSS text-shadow property to create truly 3D-looking text. You might think of text-shadow as being able to apply blurred, gradient-looking color behind text, and you would be right! But just like box-shadow, you can control how blurred the shadow is, including taking it all the way down to no blur at all. That, combined with comma-separating shadows and stacking them, is the CSS trickery we’ll be doing here.

By the end, we’ll have something that looks like this:

Quick refresher on text-shadow

The syntax is like this:

.el {
  text-shadow: [x-offset] [y-offset] [blur] [color];
}
  • x-offset: Position on the x-axis. A positive value moves the shadow to the right, a negative value moves the shadow to the left. (required)
  • y-offset: Position on the y-axis. A positive value moves the shadow to the bottom, a negative value moves the shadow to the top. (required)
  • blur: How much blur the shadow should have. The higher the value, the softer the shadow. The default value is 0px (no blur). (optional)
  • color: The color of the shadow. (required)

The first shadow

Let’s start creating our effect by adding just one shadow. The shadow will be pushed 6px to the right and 6px to the bottom:

:root {
  --text: #5362F6; /* Blue */
  --shadow: #E485F8; /* Pink */
}


.playful {
  color: var(--text);
  text-shadow: 6px 6px var(--shadow);
}

Creating depth with more shadows

All we have is a flat shadow at this point — there’s not much 3D to it yet. We can create the depth and connect the shadow to the actual text by adding more text-shadow instances to the same element. All it takes is comma-separating them. Let’s start with adding one more in the middle:

.playful {
  color: var(--text);
  text-shadow: 6px 6px var(--shadow),
               3px 3px var(--shadow);
}

This is already getting somewhere, but we’ll need to add a few more shadows for it to look good. The more steps we add, the more detailed the the end result will be. In this example, we’ll start from 6px 6px and gradually build down in 0.25px increments until we’ve reached 0.

.playful {
  color: var(--text);
  text-shadow: 
    6px 6px        var(--shadow), 
    5.75px 5.75px  var(--shadow), 
    5.5px 5.5px    var(--shadow), 
    5.25px 5.25px  var(--shadow),
    5px 5px        var(--shadow), 
    4.75px 4.75px  var(--shadow), 
    4.5px 4.5px    var(--shadow), 
    4.25px 4.25px  var(--shadow),
    4px 4px        var(--shadow),
    3.75px 3.75px  var(--shadow),
    3.5px 3.5px    var(--shadow),
    3.25px 3.25px  var(--shadow),
    3px 3px        var(--shadow),
    2.75px 2.75px  var(--shadow),
    2.5px 2.5px    var(--shadow),
    2.25px 2.25px  var(--shadow),
    2px 2px        var(--shadow),
    1.75px 1.75px  var(--shadow),
    1.5px 1.5px    var(--shadow),
    1.25px 1.25px  var(--shadow),
    1px 1px        var(--shadow),
    0.75px 0.75px  var(--shadow),
    0.5px 0.5px    var(--shadow),
    0.25px 0.25px  var(--shadow);
}

Simplifying the code with Sass

The result may look good, but the code right now is quite hard to read and edit. If we want to make the shadow larger, we’d have to do a lot of copying and pasting to achieve it. For example, increasing the shadow size to 10px would mean adding 16 more shadows manually.

And that’s where SCSS comes in the picture. We can use functions to automate generating all of the shadows.

@function textShadow($precision, $size, $color){
  $value: null; 
  $offset: 0;
  $length: $size * (1 / $precision) - 1;


  @for $i from 0 through $length {
    $offset: $offset + $precision;
    $shadow: $offset + px $offset + px $color;
    $value: append($value, $shadow, comma);
  }


  @return $value;
}


.playful {
  color: #5362F6;
  text-shadow: textShadow(0.25, 6, #E485F8);
}

The function textShadow takes three different arguments: the precision, size and color of the shadow. It then creates a loop where the offset gets increased by $precision (in this case, it’s 0.25px) until it reaches the total size (in this case 6px) of the shadow.

This way we can easily increase the size or precision of the shadow. For example, to create a shadow that’s 10px large and increases with 0.1px, we would only have to change this in our code:

text-shadow: textShadow(0.1, 10, #E485F8);

Alternating colors

We want to spice things up a bit by going for alternating colors. We will split up the text in individual letters wrapped in spans (this can be done manually, or automated with React or JavaScript). The output will look like this:

<p class="playful" aria-label="Wash your hands!">
  <span aria-hidden="true">W</span><span aria-hidden="true">a</span><span aria-hidden="true">s</span><span aria-hidden="true">h</span> ...
</p>

Then we can use the :nth-child() selector on the spans to change the color of their text and shadow.

.playful span:nth-child(2n) {
  color: #ED625C;
  text-shadow: textShadow(0.25, 6, #F2A063);
}

If we had done this in vanilla CSS, then here’s what we’d end up with:

.playful span {
  color: var(--text);
  text-shadow: 
    6px 6px var(--shadow),
    5.75px 5.75px var(--shadow),
    5.5px 5.5px var(--shadow),
    5.25px 5.25px var(--shadow),
    5px 5px var(--shadow),
    4.75px 4.75px var(--shadow),
    4.5px 4.5px var(--shadow),
    4.25px 4.25px var(--shadow),
    4px 4px var(--shadow),
    3.75px 3.75px var(--shadow),
    3.5px 3.5px var(--shadow),
    3.25px 3.25px var(--shadow),
    3px 3px var(--shadow),'
    2.75px 2.75px var(--shadow),
    2.5px 2.5px var(--shadow),
    2.25px 2.25px var(--shadow),
    2px 2px var(--shadow),
    1.75px 1.75px var(--shadow),
    1.5px 1.5px var(--shadow),
    1.25px 1.25px var(--shadow),
    1px 1px var(--shadow),
    0.75px 0.75px var(--shadow),
    0.5px 0.5px var(--shadow),
    0.25px 0.25px var(--shadow);
}


.playful span:nth-child(2n) {
  --text: #ED625C;
  --shadow: #F2A063;
}

We can repeat the same a couple of times with other colors and indexes until we achieve a pattern we like:

Bonus points: Adding animation

Using the same principles, we can bring the text to life even more by adding animations. First, we’ll add a repeating animation that makes each span move up and down:

.playful span {
  color: #5362F6;
  text-shadow: textShadow(0.25, 6, #E485F8);
  position: relative;
  animation: scatter 1.75s infinite;
}

We can optimize this a little further by using the prefers-reduced-motion media query. That way, folks who don’t want the animation won’t get it.

.playful span {
  color: #5362F6;
  text-shadow: textShadow(0.25, 6, #E485F8);
  position: relative;
  animation: scatter 1.75s infinite;
}

@media screen and (prefers-reduced-motion: reduce) {
  animation: none;
}

Then, in each nth-child(n) we’ll add a different animation delay.

.playful span:nth-child(2n) {
  color: #ED625C;
  text-shadow: textShadow(0.25, 6, #F2A063);
  animation-delay: 0.3s;
}



Source link

Post image
Strategy

Learn Full Stack Web Development from Home -Self Starter Way…


What is a Full Stack developer?

FULL STACK DEVELOPER is an engineer who works on both client-side and server-side software. This type of software developer works on the Full Stack of an application meaning Front End Technology, Back End Development Languages, Database, Server, API, and version Controlling Systems. Hence, the name “Full Stack” Developer.

Why do you need a Full-Stack Developer?

Here are some prominent reasons why you should hire a full stack development professional:

  • Full stack developer helps you to keep every part of the system running smoothly

  • Full stack developer can provide help to everyone in the team and greatly reduce the time and technical costs of team communication

  • If one person plays different roles, it saves your company’s personnel, infrastructure and operational cost

Full Stack Developer Salary

As a FULL STACK DEVELOPER, you are likely to earn $127000 per year.

Post image
Post image

Full Stack Developer Salary

In this UK, the salary range is £40,000 – £70,000.

NASSCOM predicts the Indian IT/ITeS Industry to increase to USD 350 BN by 2025 which results in an addition of Job opportunities of around 2.5-3 million jobs!

How to prepare to be Full Stack Developer

Based on the expectations mentioned above, if you’re looking to prepare yourselves to become a full stack developer, you need to work on the following:

Step 1: Choose a tech stack

While there are many languages/frameworks to pick and choose, here are the major decision points based on current industry trends:

  • Front end frameworks – Angular vs React

  • Back end languages – Java (Spring) vs. Node.js (Express)

  • Database – mySQL vs Mongo DB

You can either pick MEAN/MERN stack which is a complete JavaScript based stack to build applications or Java(Spring) + React/Angular for building web applications. But the important point here is to stick to the stack and build experience and proficiency in the same.

Best Courses to Learn Full Stack Web Development

If you would like to go from knowing nothing to becoming a full-stack web developer career-starter then go for this relatively unknown but useful Full-Stack Web Development Mini-Degree.

This is unknown platform to many of us but it gives a good content as compares to others, In the end, according to me, learning matters and not the platform.

This Degree includes :-

This project-oriented curriculum begins by covering the foundations of programming and web development. You’ll learn to create responsive and interactive websites as you get familiar with the basics. We’ll then move on to the server-side and introduce Node.js, Express, Mongo and other frameworks. You’ll be building webapps, REST API’s and scripts.

If you want to learn full stack by building project then this Complete Full stack E degree is good fit for you.

This specialized e-degree program will help you master all the technologies (stack) required in creating complex web and mobile applications from start to end.

This e-degree program will enable you to build real-world web applications using JavaScript.

Some key technologies you will learn are:

  • HTML 5
    A mark-up language used for structuring and presenting data

  • CSS
    CSS describes how HTML elements are to be displayed on screen

  • Bootstrap 4
    It is a framework for developing responsive mobile apps

  • Node, Express and React
    They are JavaScript framework for front-end and back-end development

  • Database design
    Organization of data according to database model

  • Building a PWA
    Learn how to build a progressive web app

Another good option to learn full stack is is Full Stack Web Developer Master Programme by Edureka.

It will build interactive and responsive web applications using both front-end and back-end technologies. It starts with basics of Web Development, covers JavaScript and jQuery essentials, guides you to build remarkable user interface via Angular or React, helps you to build scalable backend applications using Express & Node.js plus manage data using MongoDB.

One of the big areas that seperates the Edureka from the other online courses, in my opinion, is the community. You will meet new people, expand your professional network, make connections and even get a chance to be part of a virtual hack-a-thon that I am helping to coordinate as an enthusiastic member of the community.

and the last one I recommenced is Udemy, When it comes to online learning how we ignore udemy, it is a giant in online learning.

at the end I am just saying that all the above courses are just to give you knowledge of full stack so I have suggest you don’t rush into certification, rather focus on working on projects. Your experience will help you get the job of full-stack developer., and not your certificate.

Thanks for Reading



Source link

Post image
Strategy

Help with typography poster : graphic_design


Hey all,

So I’m doing a poster project for my typography class. The objective is to advertise the class to prospective students. I was advised by my professor that she liked the design but she says I could push the typography in a more interesting way. Is there anything you could suggest? Maybe a different font that would suit this design better? I’ve been on a Poppins kick lately! 😛

Thanks in advance!

Post image



Source link

Stupid question...how hard or easy would it be to make this type of website? Image inserted...
Strategy

Stupid question…how hard or easy would it be to make this …


Stupid question...how hard or easy would it be to make this type of website? Image inserted...

I don't know anything about web development, but I wanted to start getting an idea of how much something with this format but different metrics would cost me if I ended up hiring someone to build it out.

https://preview.redd.it/ymxncsje4wt41.png?width=1184&format=png&auto=webp&s=48d578b0445f16e3bd57ac832a07f6b9a4c23eaa

submitted by /u/LSDMOLLYSHROOMS
[comments]



Source link