teleren/devto huggingface dataset:
Elastic Beanstalk CLI Quick Command List
Tags: aws, ebs, devops, cloud
Published: 2021-01-13 10:13:55


Here's a quick list of the AWS Elastic Beanstalk CLI Commands and their description for the super busy developer.

`eb init`
- Used to configure a local repository for your Elastic Beanstalk environment and source code. This will prompt you for your aws-access-id & aws-secret-key to connect to your aws account. 

`eb list`
- Lists down all environments that are present for your application

`eb open` 
- Opens the public url of the application

`eb health`
- To check the status of the application and various instances

`eb events`
- Prints the latest events for the specific environment 

`eb appversion`
- Shows all app versions which are available in an interactive mode. User can delete a version of the application or create the application version lifecycle policy

`eb config`
- Gets all config of the environment. Saves the environment configuration settings as well as uploads, downloads, or lists saved configurations

`eb terminate`
- Terminates the environment 

`eb restore`
- Rebuilds a terminated environment, creating a new environment with the same name, ID, and configuration

`eb upgrade`
- Upgrades the platform of your environment to the most recent version available for the platform

`eb clone`
- Clones the environment 

`eb create`
- Creates a new environment and deploys an application version to it

`eb abort`
- Cancels an upgrade when environment configuration changes to instances are still in progress

`eb scale`
- Scales the environment to always run on a specified number of instances, setting both the minimum and maximum number of instances to the specified number

`eb swap`
- Helps you swap the environment's CNAME with the CNAME of another environment to avoid any down time

`eb logs`
- Retrieves the tail logs of your environment

`eb logs --all`
- Retrieves all logs of your environment

`eb setenv`
- Set an environment property

`eb printenv`
- Prints the environment properties

`eb deploy`
- Deploys the application source bundle from the initialized project directory to the running application

`eb codesource`
- Configures the EB CLI to deploy from a CodeCommit repository, or disables CodeCommit integration and uploads the source bundle from your local machine

`eb ssh`
- Allows you to ssh into a non windows server/instance

`eb tags`
- Add, delete, update, and list tags of an Elastic Beanstalk resource


Overall elastic beanstalk CLI is pretty straight forward to use for the beginner/intermediate developer. 
For additional options and remaining commands check out the For the full list refer to [AWS official documentation](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-cmd-commands.html)
What's your favorite command?
Milestone: Half a million downloads for VideoLAN packages in the .NET ecosystem
Tags: libvlc, dotnet, multimedia, libvlcsharp
Published: 2021-01-13 10:02:56

[The NuGet VideoLAN account](https://www.nuget.org/profiles/videolan) just reached half a million downloads in the .NET ecosystem. 

![](https://mfkl.github.io/assets/nugettrends.png)

The first publication of the first VideoLAN NuGet package dates back to April 1st, 2018 (no joke!). We have been steadily adding new packages since then to cover all platforms supported by both LibVLC and .NET.

Today, we actively publish and maintain **15 NuGet packages**, 6 of which  actually containing native platform-specific code. The remaining 9 packages are managed C# DLLs composed of the main binding ([LibVLCSharp](https://www.nuget.org/packages/LibVLCSharp/)) and various GUI toolkit integrations for getting users up and running quickly.

- Xamarin.Android
- Xamarin.iOS
- Xamarin.tvOS
- Xamarin.Mac (Cocoa)
- Windows Classic (WPF, WinForms, GTK)
- Windows Universal (UWP for Desktop, mobile and Xbox)
- Linux including desktop, server and Raspberry Pi (GTK)
- Xamarin.Forms
- Uno Platform (UWP, Android, iOS)
- Avalonia (Windows, macOS, Linux)

LibVLCSharp counts about **19 contributors**, with most people doing one-off contributions and mainly 2 active maintainers ([Jérémy](https://github.com/jeremyVignelles) and myself). I'd like to thank each of them for their valuable OSS contributions!

# What's next?

Many exciting things! More game engine integrations, ongoing LibVLC 4 support, interop performance improvements and plenty of new integrations, samples and features are yet to be implemented.

We have a diverse and (mostly) well-defined [backlog](https://code.videolan.org/videolan/LibVLCSharp/-/issues) of both features to implement and bugs to fix, with a varying degree of difficulty, and always welcome new contributors. We are available on the [LibVLC community Discord server](https://discord.gg/3h3K3JF) (320+ members).

Feel free to let me know what you think on [Twitter](https://twitter.com/martz2804).
MLH Local Hack Day : Build 2020 #LocalHackDay
Tags: localhackday, mlh
Published: 2021-01-13 10:02:11

Major League hacking's local hack day Build is a global day-long hack day, which brings ideas to life with a worldwide community.

The Local Hack Day Build was scheduled from the Sunday, January 10th to Monday, January 18th across the globe even in this pandemic. It is now converted to online format which makes it more easy for all of the participants to from different timezones to work together. This is a week long Hackathon hosted by MLH. A huge shout out to MLH people who hosted this in such a great way. In this Hackathon 200+ guilds participate and earn points to be on top of the leader board. The members of the guild do the tasks and challenges each day of the Hackathon to get those points. Competition is not the only thing in this Hackathon. This Hackathon is mainly about learning, pushing your limits, getting out of the comfort zone and networking! So out of 200+ guilds I chose Eddie hub guild. The folks at this guild are Amazing! They are super welcoming, super active and supporting community.So the day 1 started with an opening ceremony and then started the challenges. We become more stronger each day after completing each challenge. They are designed in such a way that you can get some easy points and push yourselves to do those projects and gain points. It's a win win for both beginners as well as experienced programmers aka hackers as beginners get to start their journey and learn, experienced gets to test their skills and analyze themselves. The mentors are awesome, they encourage beginners to experiment and submit whatever they build, you'll never feel left out and if you're stuck somewhere they help you out,just reach out to them that's all. Our guild is on 2nd position on the leaderboard 🎉 and I'm sure we'll make it to 1st soon. I have met people who are just starting and Eddie hub made them feel so welcomed. I'm writing this blog on  day 3 of Hackathon and I have learnt so much, met so many people from different timezones, experiences. Thank you MLH for bringing so many people across the globe together! I'm looking forward to more of these challenges, community bonding times and memories I will make throughout this week! 
Happy hacking!
Get a customer success dashboard template. Neat & free 💯
Tags: webdev, showdev, ui, beginners
Published: 2021-01-13 09:59:29

Forget about the hassle of trying to maintain business health – grab a ready-made customer success management dashboard.
Totally free, responsive, and customizable.
Download it as a code & use outside UI Bakery if needed. No lock-in!
👇
[Get a template](https://uibakery.io/templates/customer-success-dashboard?utm_campaign=ui_bakery%20-%20template%20-%20customer_success_dashboard%20-%20cacq%20-%20xx%20-%20views&utm_source=DevTo&utm_medium=webdev&utm_content=dashboard_announce)
Top 10 VS Code Keyboard Shortcuts ⌨
Tags: beginners, vscode, learning, code
Published: 2021-01-13 09:31:40

Let's get right into it: here are my top 10 most useful VS Code keyboard shortcuts. Some of these I've learnt in the past year 🙂

### Video
If you prefer, I've gone through these in video on my YouTube channel, [dcode](https://www.youtube.com/dcode-software)

{% youtube L5sljn47J3M %}

## 1. Reveal in file explorer
**CTRL + K, R**
Reveals the active document in the file explorer. Before I knew about this, I used to right-click the side bar and reveal the file from there 😔

## 2. Go to symbol
**CTRL + SHIFT + O**
Opens up a list of symbols in the current file. This especially comes in handy when you have a large class and need to jump to a particular method 🦘

## 3. Go to line
**CTRL + G**
Allows you to jump directly to a line by using the line number. This saves me time when colleagues give me a line number 🔢

## 4. Move line up/down
**ALT + DOWN/UP**
I think most people know this one. You can use it to move a line up or down ⬆

## 5. Copy line up/down
**SHIFT + ALT + DOWN/UP**
Similar to the last one, but this will copy a line up or down 🖨

## 6. Remove current line
**CTRL + SHIFT + K**
I struggle to get used to using this one, but as the name suggests, it will delete the current line ❌

## 7 . Trigger suggestion
**CTRL + SPACE**
This one will trigger the suggestion window to appear again if you accidently get into a situation where it's lost ⚡

## 8. Trigger parameter hints
**CTRL + SHIFT + SPACE**
Similar to the last one, but this one will trigger parameter hints for a method of function if you lose them. Definitely helpful for long parameter lists! 📈

## 9. Select all occurrences of current word
**CTRL + F2**
As the name suggests, using this shortcut will automatically select all occurrences of the active word 🔡

## 10. Select all occurrences of current selection
**CTRL + SHIFT + L**
Lastly, this one will select all occurrences of the current/active selection. Very useful for file-wide replacements 📑

For a full list of VS Code shortcuts, check out their [Keyboard reference sheets](https://code.visualstudio.com/docs/getstarted/tips-and-tricks#_keyboard-reference-sheets)

**Hope I taught you at least one of these shortcuts! 😁**
HTTP Requests
Tags: crio, cwod, shareyourlearning, learnbydoing
Published: 2021-01-13 09:25:55

In this article, we are going to talk about Requests in HTTP, but first **what is this HTTP?** 
![HTTP everywhere](https://memegenerator.net/img/instances/85193327/http-everywhere.jpg)
HTTP is a protocol that allows the fetching of resources, and it's the biggest protocol on the web like the most important one. because it is the base of any data exchange on the web and it is Primarily used to fetch HTML documents. it is a client-server protocol, so basically it means the requests are generated by the client(your browser) after sending the request the server responds to the client with some data.

Let's see what are those requests that HTTP uses.

1.**GET**: The GET method requests a representation of the specified resource. Requests using GET should not modify data they should be used to retrieve data.

2.**POST**: Post request is used for Creating or uploading data on the server and changes the state of the server. Eg. Posting on social media.

3.**PUT**: PUT requests are used to completely update data on the server. eg. updating profile

4.**DELETE**: As the name implies this request is used to delete the data on the server.

There are many more methods like HEAD, CONNECT, TRACE, PATCH that we will discuss later.
Laravel 8 Database Notifications with Models using Collection Macro
Tags: laravel, php, webdev
Published: 2021-01-13 09:16:57

Laravel comes with a built-in system for notifications. There are various channels for sending these notifications, such as - email, SMS & more. One of them is via the database wherein the notifications are stored and can be read as per your need.

Disclaimer - I'm assuming you are somewhat familiar with Laravel.

As per Laravel 8's [official docs on Notifications](https://laravel.com/docs/8.x/notifications#formatting-database-notifications), you can add 'data' to your notification by utilizing `toDatabase()` or `toArray()` method.
```php
public function toDatabase($notifiable)
{
    return [
        'product_name' => $this->product->name,
        'user_name' => $this->user->name,
    ];
}
```
& you can then display the notification in your views (via Controller).
```html
<div>
    {{ $notification->data['user_name'] }} ordered {{ $notification->data['product_name'] }}
</div>
```
But what if the product's name or user's name was updated? This is why you might want to store the IDs instead.
```php
public function toDatabase($notifiable)
{
    return [
        'product_id' => $this->product->id,
        'user_id' => $this->user->id,
    ];
}
```
Now, how about displaying the data in this approach? Well, you can fetch the respective product and user models in a controller like...
```php
public function index() {
    $notifications = $user->notifications;
    foreach($notifications as $notification) {
       // populate data from models
       ...
    }
    return view('notifications', compact('notifications'));
}
```
...wherein you can read the notification type and load respective models.

But should this be a concern of a controller? One of the simpler ways you can handle this is macroing on the `DatabaseNotificationCollection` inside of, perhaps, your `AppServiceProvider` like...
```php
public function boot()
    {
        //
        DatabaseNotificationCollection::macro('addModels', function () {
            return $this->each(function ($notification) {
                // populate data from models
                ...
            });
        });
    }
```
which then allows you to optionally load models for the notification collection via a controller like...
```php
public function index() {
    $notifications = $user->notifications->addModels();
    return view('notifications', compact('notifications'));
}
```
I've implemented a similar approach to Notifications for the purpose of demonstration on my [GitHub repo](https://github.com/zaxwebs/ex-l8-model-notifs). I have a custom convention in place. Feel free to have a look and add to.

Liked what you read? Support me here: https://www.buymeacoffee.com/zaxwebs
Will Golang ever stop using their strict GOPATH path in order to code with it
Tags: discuss, go
Published: 2021-01-13 09:15:58

When I started learning, being a beginner it was such a hustle to set it up, nowadays I am okay with setting up on any PC but for new beginners its not that pleases. 

Is there a reason it's setup that way and not like node or python where you install and can write your script anywhere on your PC without any path related issues?
Learn Java
Tags: java
Published: 2021-01-13 08:44:50

<a href="https://www.ebhor.com/java-first-program/">Java Program Structure and First Program</a>

<a href="https://www.ebhor.com/java-applet-example/">Java Applet Example</a>
<a href="https://www.ebhor.com/simple-calculator-in-java-applet/">Simple Calculator in Java Applet</a>
How do you deal with large GIF sizes?
Tags: discuss, gif, optimization
Published: 2021-01-13 08:32:04

---
title: How do you deal with large GIF sizes?
published: true
description: 
tags: discuss, gif, optimization
cover_image: https://woorkup.com/wp-content/uploads/2016/09/compress-animated-gif.png
---
Often time in a developer workflow we need to capture some short animations. That's where GIFs come in as a rescue.

Tho capturing higher resolution areas for like 10 secs comes at its price - larger file sizes, meaning longer load times for wherever you use them afterward in your projects.

How do you optimize your GIFs?
First week Javascript
Tags: javascript, webdev, programming
Published: 2021-01-13 08:20:30

Hi Everyone, it has been one whole week, since I have started learning javascript and I have discovered there is a lot to learn in this programming. I started with fundamental js and I have completed simple concepts like variables, function, loops, strings, and their function, Array and it's function, class, objects, Arrow function, JSON, module, map, and set and currently learning Asynchronicity. I learned all these concepts by reading online and try to 3-4 questions on each concept and amazingly this method works best for me learning any concept because if there is any hole in knowledge for a concept after doing some question you can cover it.

Links where I am learning:
https://www.w3schools.com/js/DEFAULT.asp
https://javascript.info/
https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics
https://www.educba.com/software-development/software-development-tutorials/javascript-tutorial/
Creating a Salesforce Extension: From Idea to Listing on AppExchange
Tags: appexchange, salesforce, salesforcepartner
Published: 2021-01-13 08:17:28

Salesforce lets you start with an idea and turn it into a business. Take a look at the journey from ideation to being listed on AppExchange. Here is a guide written by a Salesforce Partner - [Creating a Salesforce Extension: From Idea to Listing on Appexchange](Salesforce lets you start with an idea and turn it into a business. Take a look at the journey from ideation to being listed on AppExchange. Here is a guide written by a Salesforce Partner - Creating a Salesforce Extension: From Idea to Listing on Appexchange)
How Salesforce’s Work.com Can Help Your Business Reopen Safely after or during the Pandemic
Tags: getbacktowork, isolation, management, reopensafely
Published: 2021-01-13 08:15:51

To help customers address the challenges associated with COVID-19, Salesforce has added new features to work.com. Here is an overview of what is included https://www.brimit.com/blog/how-salesforce-work-com-can-help-your-business-reopen-safely-after-or-during-the-pandemic
Embed an Exe file in .NetCore
Tags: netcore, csharp
Published: 2021-01-13 08:14:31

Sometimes you don't want your user to install an external exe which is needed by your program.
I have to use Pandoc.exe in one of my program. I have decided to embed it in my own exe and at runtime copy the resource to a tmp directory.
You could perhaps experience problems with you anti-virus.

Here is the code from [How to embed exe or resource file in c# assembly ](https://www.codeguru.co.in/2011/07/how-to-embed-exe-or-resource-file-in-c.html):

```csharp
using System;
using System.IO;
using System.Reflection;

namespace PandocEmbed
{
  class Program
  {
    private static void ReadResourceNameFromAssembly()
    {
      foreach (var resourceName in Assembly
        .GetExecutingAssembly()
        .GetManifestResourceNames())
      {
        Console.WriteLine(resourceName);
      }
    }

    static void Main(string[] args)
    {
      // From here you can read the name of your embeded resource.
      ReadResourceNameFromAssembly();

      string resourceName = "PandocEmbed.pandoc.exe";
      Assembly currentAssembly = Assembly.GetExecutingAssembly();
      FileStream outputFileStream = new FileStream(@"c:\temp\pandoc.exe", FileMode.OpenOrCreate);
      Stream res = currentAssembly.GetManifestResourceStream(resourceName);
      if (res != null)
      {
        res.CopyTo(outputFileStream);
        res.Close();
      }
      outputFileStream.Close();
    }
  }
}

```
What's your favorite URL shortener?
Tags: discuss, url, productivity
Published: 2021-01-13 08:09:51

---
title: What's your favorite URL shortener?
published: true
description: 
tags: discuss, url, productivity
cover_image: https://www.elegantthemes.com/blog/wp-content/uploads/2015/02/custom-trackable-short-url-feature.png
---
Very long URLs look bad, take up a lot of character space, are a nightmare to share with other people, etc. That's where URL shorteners come in.

Do you use some online services like [bitly](https://bitly.com/) and [tinyurl](https://tinyurl.com/)?
Or use some extensions, like [URL Shotener](https://chrome.google.com/webstore/detail/url-shortener/godoifjoiadanijplaghmhgfeffnblib)?
Maybe you use some automated solution?

What is your way of dealing with long URLs?
How to use POSTGRESQL image container in your next project ?
Tags: postgres, docker, mount, help
Published: 2021-01-13 08:09:20

Using docker is a life saver for each and every developer out there, for development as well as production purpose. The main reason for this is that it scales and spins up in milliseconds.


PostgreSQL is one of the popular database out there. Many of the developers use it in daily purpose because of its efficiency and simplicity.

To create a container of PostgreSQL, first we must download its image from the [docker hub](https://hub.docker.com/) ( official docker images repository ). 

You can find the link for PostgreSQL [here](https://hub.docker.com/_/postgres).

Here, we can use download the latest docker image by using the latest tag. You can checkout others too in the link above.

To install the image locally in our system, we use the following command:

```docker 
docker pull postgres:latest
```

After this, we can spin our PostgreSQL image and create a new container.

For this, we use the following command,
```
docker
docker run --name name_of_your_container -e POSTGRES_USER=username_for_the_container -e POSTGRES_PASSWORD=password_for_the_container -e _containerized -p 5432:5432 --mount type=volume,source=pgdata,destination=/var/lib/postgresql -d postgres
```
😱 😱 Don't be panic, I will explain each and every line.

Here, docker `run` commands docker to create an container of the given name `--name` with some environment variables ( key and value pair "=" )`-e`. Currently we are using three of them, and there are more which you can use according to your need.

1. POSTGRES_USER: Creates a postgres user of provided name for the container followed by POSTGRES_PASSWORD.
2. POSTGRES_PASSWORD: Sets the password for the user.

As PostgreSQL runs on port 5432, the `-p` maps the port 5432 of the container to our local port 5432 so that we can access it easily.

To have persistent data we create a volume and map to it.
Here `--mount type=volume,source=pgdata,destination=/var/lib/postgresql`, we mounted our volume and mapped the data of PostgreSQL of our container with the volume we created i.e. pgdata.

At last, we now tell docker to run it in detach mode (`-d`) following by the name of image i.e postgres.
Passing objects into Angular 10 Storybook 6 stories
Published: 2021-01-13 08:07:58

I'd put the most important thing first. The solution is below.

```javascript
const Template: Story<SomeAngularComponent> = (args: SomeAngularComponent) => ({
  component: SomeAngularComponent,
  template: `<some-angular-component [height]="height" [data]="data">`,
  props: {
    ...args,
    data: { id: 1, name: 'SomeObjects' },
    height: '300px',
  },
});
```
ENV

Angular version: 10.0.4
Storybook version : 6.1.14


I was trying to pass some objects into my Angular component, so I followed the instruction on https://storybook.js.org/blog/introducing-storybook-args/

Like so...
```JavaScript
const Template: Story<LineChartComponent> = (args: LineChartComponent) => ({
  component: LineChartComponent,
  props: args
)};

export const Default = Template.bind({});
Default.args = { data: { id: 1, name: 'SomeObjects' } };

```
However, my Angular component did not receive the data object.
It took me a while to figure this one out.