teleren/devto huggingface dataset:
Tools for creating shell command in PHP
Tags: linux, php, shell, framework
Published: 2020-11-26 16:54:22

---
title: Tools for creating shell command in PHP
published: true
description: Suggestions for creating shell command in PHP
tags: linux, php, shell, framework
---

I had to create a cli tool that reads excels file and push each row data to a web service.

It has to be called once a day using linux crontab.

Usually I create such software (middleware ?) from the scratch in PHP that is  already present in the server.

I got many of these custom client applications and I would like to create a more structured application using a framework.

I tried [Symfony console](https://symfony.com/doc/current/components/console.html) and it works, but I'm not happy.

I have 12 Mb of php scripts in vendor folder and 50 Kb of my code: an elephant that produce a mouse.

Moreover the server has php 7.0 so I have to use an old version on the framework (3.4).

When I will upgrade the server (next spring I suppose) I have fear to upgrade the framework to a more recent version (5.1) with a completely different logic.

What shall I do?

Any suggestion for a lightweight framework for a php cli command?

Thank you for your patience.
How To Download Instagram Video & Photo In 2021
Published: 2020-11-27 05:33:12

Do you want to download video & photos from Instagram? then yes you to the right place I am going to tell your 100% working are method with that you not only download video & phots, you can also download reels, IGTV, and stories even from the private Instagram account. so without further ado, let's get started

Here, to download Instagram video & photo we use a tool that is <a href="https://igstoriesig.com/">IG StoriesIG</a>, it is 100% working tools on the internet world which support anything download from Instagram, even you can watch Instagram stories Anonymously

So, how to use that - First off visit IG StoriesTG, and now copy any Instagram post URL/Username and past it on it

it automatically syncs all Instagram post and video from that account, now click on the download button and download it

and make for download from private you must be logged in with your Instagram account on your browser

Thanks for reading
How to clean orphan packages in one line
Tags: linux, bash, shell, bestpractice
Published: 2020-11-27 05:27:47

I am not a GNU/Linux master, nor a terminal expert, i was going to make a bash script to clean orphan packages, then i read this...
> Using arrays or loops in shells is often signs of bad coding practice.
* Source: [store the command output in an array and print one by one](https://unix.stackexchange.com/a/149667).

***

... So i decided to research about `awk`, and i did this **one-line command to clean your orphan pacman packages** `sudo pacman -R $(pacman -Qdt | awk '{print $1}')`  

  
 - `pacman -Qdt`: Used to display the orphan packages.
 - `awk '{print $1}'`: Prints the first field of the output.

  
![e.g](https://dev-to-uploads.s3.amazonaws.com/i/zyqd2ch5l6mo3prwbnbd.png)
Huge Discounts in UI Kits, Dashboard Templates From Authentic Developers
Tags: blackfriday
Published: 2020-11-27 05:19:15

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/tvrw2e9l7k5049vq8nkm.png)

The good news for designers, developers & project owners that Black Friday is here to grab the huge discounts on various web products which helps you in your development time. 

I'm excited to write here about this post to highlight a few Authentic companies that give a really great deal from 50% to 90% off on their templates.

Companies here I'm highlighting are - CodedThemes, WrapPixel, Appseed, Creative-Tim, Bootstrapdash & Themesberg.

I used the term Authentic companies because the mentioned companies have a good reputation from thousands of customers with outstanding products in a wide range of technologies and categories. 

Categories like UI kits, Dashboard Template & App Generators in Bootstrap, Angular, Vuejs, Reactjs, Node, Asp.net, Flask, Django & Laravel frameworks.

###[CodedThemes](https://codedthemes.com/)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gf1usdj7v5u52cjxe08z.png)

50% off on all products which includes UI Kits, Figma Kits, Admin Templates in Reactjs, Angular & Bootstrap 4 frameworks.
* 7 Bootstrap 4 Admin Templates
* 1 Bootstrap UI Kit
* 2 Figma UI Kit
* 5 Angular Dashboards
* 2 ReactJs Dashboards
* 2 Mega Bundle Products

###[Wrappixel](https://www.wrappixel.com/)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/a72vmyjry9eg65sil505.png)

95% off on bundle products which includes the following deal.
* 12 Bootstrap templates.
* 8 Angular templates.
* 5 React templates.
* 3 Vuejs templates.
* WrapKit Bootstrap UI.
* 29+ domains.

###[AppSeed](https://appseed.us/)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cke0w6szm4lxptlmg8yz.png)

Up to 73% off on Appseed web App Generator. You can get the Flask/Django framework dashboards with 24/7 Live support.

###[Creative-tim](https://www.creative-tim.com/)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/d58zy1uiihf7d5mcjwxy.png)

Get 90% Off on Creative-Tim products which include all technologies stack products.

###[BootstrapDash](https://www.bootstrapdash.com/)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3h7jkzg866faobh4l6da.png)

They offer a Flat 25% off on Bundle products & a Flat 20% off on All other Templates. The offer is valid till November 30.

###[Themesberg](https://themesberg.com/black-friday)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/kbs7r1c9xbevvnv9fmjy.png)

90% off on bundle product with having 7 Premium Bootstrap Themes along with 6/12 months support.

Hope you like these deals. I wish all of you a happy thanksgiving day.
3 Ways To Center Elements In CSS

Tags: javascript, css, webdev, html
Published: 2020-11-27 05:17:27

Web developers come across many instances in everyday life where they have to center the elements. It is also very common and important concept that is asked during interviews. So today I would like to list out my favorite three ways of centering the things using CSS.

![Centered Elements](https://miro.medium.com/max/1050/1*tm63JHZ5qsNfAF-czwYbaw.png)

We have two div elements one inside the other. Outer div has id=’container’ and the inner container has a id = ‘content’. And inside it we have an icon.

```html
<div id="container">        
  <div id="content">   
     <i class="fa fa-beer" style="font-size:24px"></i>       
  </div>      
</div>
```
![Centered Elements](https://miro.medium.com/max/1050/1*OLqMWQdxMhiJYNqdBfBReA.png)

##1 . Using Flexbox
We can use flexbox to center the element. For this we assign display property to flex. For centering items, we are using properties justify-content and align-items and assigning it to center.

```css
#container {
  background: #eee;
  height: 500px;
  width: 100%;
  
  display: flex;
  justify-content: center;
  align-items: center;
}

#content {
  background: pink;
  height: 100px;
  width: 200px;
  
  display: flex;
  justify-content: center;
  align-items: center;
}
```
##2. Using Grid
Centering the elements using grid is one more efficient way. We can use display property to make use of grid. The place-items property is made use to bring the element to center.
```css
#container {
  background: #eee;
  height: 500px;
  width: 100%;
  position: relative;

  display: grid;
  place-items: center;
}

#content {
  top: 50%;
  background: pink;
  height: 100px;
  width: 200px;

  display: grid;
  place-items: center;
}
```
##3. Using Position Property
Another way is old- age method of using position property to center the things. We have used margin, top, right, bottom and left properties for position.

```css
#container {
  background: #eee;
  height: 500px;
  width: 100%;

  position: relative;
}

#content {
  top: 50%;
  background: pink;
  height: 100px;
  width: 200px;

  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  top: 0;
  margin: auto;
  /* to align the icon */
  text-align: center;
  line-height: 120px;
}
```
Best Keras Online Courses You Need to Know in 2021
Tags: machinelearning, datascience, deeplearning
Published: 2020-11-27 05:10:29

Keras is a high-level library that’s built on top of **Theano or TensorFlow.** And Keras provides a **scikit-learn type API for building Neural Networks.** 

By using Keras, you can easily build **neural networks** without worrying about the mathematical aspects of tensor algebra, numerical techniques, and optimization methods. That’s why in this article, I am gonna discuss Best Keras Online Courses.

I have filtered these courses on the following criteria-

##**Criteria-**
1. Rating of these Courses.
2. Coverage of Topics.
3. Engaging trainer and Interesting lectures.
4. Number of Students Benefitted.
5. Good Reviews from various aggregators and forums.

But before discussing the best keras online courses, I would like to mention **few reasons to learn Keras.**

1.  Keras provides **Multi-GPU and strong distributed support.** So you can run your deep learning models on large GPU clusters.

2. Keras has a **simple API** and that’s why it is the most easy-to-use library for machine learning for beginners. 

3. It has **strong backend support.** Keras acts as a wrapper that allows us to use either TensorFlow, theano, or any other framework.

4. Due to its **Pythonic nature**, Keras need less code and it is **easy to debug and easy to deploy.**

So these are few reasons to choose Keras. Now let’s move to the **Keras courses.**
**[Click to continue reading...](https://www.mltut.com/best-keras-online-courses/#1-introduction-to-deep-learning-neural-networks-with-keras-coursera)**
Emojify 🦕 text of a webpage with a Chrome Extension
Tags: javascript, webdev, showdev
Published: 2020-11-27 05:06:49

Ever wondered what would happen if you replaced all the words of a webpage with their emoji equivalent, like `t-rex` replaced with 🦖, and `dolphin` replaced with 🐬? Well look no further, I've created this Chrome Extension so you don't have to.

Visit the repository for usage and installation instructions: [Emojify Repository](https://github.com/salhernandez/emojify)

# Demo
![emojify demo](https://dev-to-uploads.s3.amazonaws.com/i/7hz5jpnc5y8bq1rlgin0.gif)

The Chrome Extension replaces single word emojis in the `p`, `h1`, `h2`, `h3`, `h4`, `h5` and `h6` tags.

# Resources needed to complete project

- List of emojis and their aliases
    - [https://github.com/github/gemoji/blob/master/db/emoji.json](https://github.com/github/gemoji/blob/master/db/emoji.json)
- [Chrome Storage API](https://developer.chrome.com/apps/storage)
- [Chrome Tabs API](https://developer.chrome.com/extensions/tabs)
Adding Netlify redirects to an Eleventy site
Tags: html, javascript
Published: 2020-11-27 04:58:24

Hey guys, a "weird" one for today, you might think ok adding some 301 redirects can't be so difficult, but the combi Netlify/Eleventy has some quirks to it.

Normally redirects would happen, in for example, a `.htaccess` file. In the case of Netlify, they want us to create a `_redirects` file.

Alright, simple enough, let's add a _redirects file to our Eleventy projects.

But here comes the difficulty, Eleventy won't output `_` prefixed files.

## How to add Netlify redirects to an Eleventy site

So then how do we go about adding them?

I'm going to showcase my approach, there might be more sides to this, but for me just needing some 301 redirect this worked perfectly.

I've added the `_redirects` file to my `src` and the content looks like this:

```js
/posts/javascript-map-function/ /posts/javascript-map-method/ 301
/posts/javascript-reduce-function/ /posts/javascript-reduce-method/ 301
/posts/javascript-filter-function/ /posts/javascript-filter-method/ 301
```

As you can see I decided to rename function to method, since it's correct that way.

Now if we would deploy this file would not be passed through, so open the `.eleventy.js` file and adjust accordingly.

```js
module.exports = function (config) {
	//All other stuff

  // Passthrough copy
	// All other passthroughs
  config.addPassthroughCopy('src/_redirects');

  return {
    dir: {
      input: 'src',
      output: 'dist'
    },
    passthroughFileCopy: true
  };
};
```

As you can see, my setup is to take from the `src` directory and output to the `dist`.
This might be different from your setup, so be aware of making changes.

Where the magic happens is this line:

```js
config.addPassthroughCopy('src/_redirects');
```

Here we tell Eleventy to add the `src/_redirects` file to our output (which is the dist folder).

If we then run this deployment Netlify deploy center will show the following:

![Netlify eleventy 301 _redirects](https://cdn.hashnode.com/res/hashnode/image/upload/v1606043639167/o7t8FMHyP.png)

Cool, we now have three redirects setup!

You can also do the same for the `_headers` file if you need that.

See it in action by opening the following URL:

[https://daily-dev-tips.com/posts/javascript-map-function/](https://daily-dev-tips.com/posts/javascript-map-function/)

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Drawing a Thanksgiving turkey with CSS
Tags: css, html, drawing
Published: 2020-11-27 04:48:33

---
title: Drawing a Thanksgiving turkey with CSS
published: true
description: Drawing a Thanksgiving turkey in HTML and CSS step by step
Tags: CSS,HTML,drawing
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/jpsq744b0sg39ed6mdyt.png
---

Today is Thanksgiving, so I decided to draw from scratch a small [Thanksgiving turkey with HTML and CSS](https://codepen.io/alvaromontoro/full/GRjKBvp):

{% codepen https://codepen.io/alvaromontoro/pen/GRjKBvp %}

The drawing is inspired by [this one](https://thanksgivingstories.com/thanksgiving-turkey-pictures-cartoons-clip-art-images.html#attachment_156), although someone mentioned that it looks like the turkeys from South Park 😅

## Drawing the turkey with CSS

The first thing was setting the stage by creating a "canvas," where the whole drawing would be contained.

A big circle positioned around the center of the canvas would be the turkey's body, and with smaller `box-shadow`s, we have the thighs too.

Next came the wings, which basically are a square with opposed rounded borders (`border-radius: 100% 0%`). We rotate them and place them on the sides of the turkey's body.

We use another circle for the head, and with a pseudo-element (`::before`), we also create the neck. Inside the head, we will have three more elements:

- The eyes are a circle and its `box-shadow`.
- For the beak –that is a triangle– we opted for using borders to generate it, but it could be done in different ways in CSS.
- And the wattle is an ellipse in which one corner is not rounded at all.

After that, the legs were simple rectangles. And with both the `::before` and `::after` pseudo-elements, we did the toes (using rotations and specifying a `transform-origin`.)

Now came a fun part: the tail feathers. We start with an oval and then clone it several times. With the `:nth-child()` selector, we can do a couple of things: give different colors to `odd` and `even` tail feathers, and rotate each feather a different degree.

The last thing is the pilgrim's hat. This is done in two parts: the bottom is an ellipse, and the top is an oval with extreme values, so it flattens a little.

We use `clip-path` to "cut" the turkey's head and make it seem like the hat is around it.

We use an inset `box-shadow` to draw a band on the hat top and a pseudo-element to make the pin for the final touches.



---

You can [watch on Youtube a time-lapse of the process](https://www.youtube.com/watch?v=RrafHaatxK0) described above:

{% youtube RrafHaatxK0 %}
Welcome to Open Source
Published: 2020-11-27 04:08:16

**What is Open source ?**

**Open source** is a way of making code freely available to all and can be redistributed with changes and anyone can contribute . In a simpler sense , Imagine that you want to develop an app and you try to develop it by yourself and you need help or you want to add more features but don't know how to , so you ask your mates for help or ask them if there is something that they feel would benefit the app , this method in a general sense is open sourcing .

**Why Open Sourcing ?**

Open sourcing is important for many reasons but it is mostly important as it allows innovation through collaboration with the public . This allows for a more efficient and feature filled softwares .

**Who use Open Source software ?**

Many developers and companies participate in Open Sourcing as it helps them to debug issues more easier or to make the software more secure and to add more features . Many of the big players in the Tech Industry such as IMB and Google , use and develop softwares through Open Sourcing .


**How do I join in ?**

Open Source platforms are easily available to all . There are many code hosting platforms where people share and contribute to one another's projects , some of the platforms are Bitbucket and Beanstalk and the most popular and commonly used ones are Github(owner ~ Microsoft) and Gitlab (owner ~ Gitlab Inc) . You can create your profile , create projects and even contribute to projects . 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zipbpk0aoeejj63mmwdo.png)


I hope this helps you understand the open source concept . If you want me to make another post on the basic functionality and tutorial of basic uses of GitHub . Do let me know below and I will be happy to do so . Cheers
A Programmer's Thanksgiving
Published: 2020-11-27 04:07:53

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4us2ltykeuvko63twret.png)

Happy Thanksgiving everyone!  2020 has been a tough year and a lot of us have experienced things we thought would never happen.  Travel bans, holidays alone, staying in your home for weeks on end, a weird test that swabs what feels like your brain...a lot!  But it's Thanksgiving now, and from one (aspiring developer) to many others, I wanted to share a few things I'm thankful for here:

1. Codenewbie Podcast/Community: If you are new to coding, you have GOT to check out this podcast and follow them on Twitter.  Each Wednesday there is a Twitter chat where you can interact with others in the community.  And their podcast covers a slew of topics that are great for every programmer.  Codenewbie has given me confidence, helped me meet other developers, and has helped me gain knowledge of the industry this year.

2. DEV Blog: I swear I'm not trying to suck-up on this site, but I'm thankful for DEV.  I've been able to read blogs from others to gain insight into coding, and I've started listening to the weekly DEVNews podcast.  DEVNews provides current events and developer topics each week, which is part of industry knowledge in my opinion.  It gets me excited to code each week when I listen to the new episode.

3. Github: Thanks to a Codenewbie friend, I got hooked up on Github in January of this year and started using it to host/save various projects.

4. freeCodeCamp: Not only has fCC helped me learn basic JavaScript this year, I also got to attend their free Lockdown Conference in April which was awesome!  Due to life changes, paying for any services was a challenge this year and freeCodeCamp was really awesome in helping me learn.

2020 was the first full year I was coding, and even though I wasn't giving a lot of time to it, I was able to learn basic JavaScript and Ruby, both of which were really fun.  Very thankful for those who share their knowledge on Twitter, the internet, this blog, and on YouTube, and I hope to be able to give back in that same way in 2021.
1. Hello World in JAVA
Tags: java
Published: 2020-11-27 04:06:11

```
public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello, Rittwick");
    }
}

```
#1. Defining the Class
JAVA has specific keywords. `public` and `static` are two of many keywords in JAVA. Keywords are case sensitive.
The **pubic** java keyword is an access modifier. An access modifier allows us to define the scope or how some other parts of my code or someone else's code can access this code. **public** access modifier is used to give full access.
The **class** keyword is used to define a class with the name following the keyword. **Hello** in this case.
To define a class requires an **optional** access modifier, followed by the class, followed by left and right curly braces.

#2. Defining the **main** method
**main** method is a special method that JAVA looks for when running a program. It is the entry point of any JAVA code.
```
public static void main(String[] args) {
        System.out.println("Hello, Rittwick");
   }
```
`public` is the access modifier.
`static` is a JAVA keyword. More about this later.
`void` is another JAVA keyword used to indicate that this method will return nothing.
Left and right parenthesis in a method declaration are mandatory and can optionally include one or more parameters - which is a way to pass information to a method.
`System.out.println("Hello World");` - This is a statement.
**Statement** is a complete command to be executed and can include one or more expressions.
Slick Slider Simple Implementation
Tags: html, javascript, css, webdev
Published: 2020-11-27 03:50:40

This blog will show how to use a slick slider or implement a slick js plugin to a website homepage. You can visit the documentation page of the slick js plugin and explore the features of this carousel. This plugin has very cool and flexible features that you can consider while working on your next project. In this project, we will make a simple homepage with a navbar, and underneath that menu, we will use the slick js plugin to create a nice-looking autoplay carousel.<a href="https://www.divinectorweb.com/2020/11/how-to-use-slick-slider-for-your-website.html">Download the Code</a>
Custom outline style with CSS
Tags: css
Published: 2020-12-04 03:16:31

---
title: Custom outline style with CSS
published: true
date: 2020-11-27 03:40:25 UTC
tags: css
canonical_url: https://phongduong.dev/blog/custom-outline-style-with-css/
---
You can custom the outline of the component when you focus on it. CSS allows you to custom these properties:

* `outline-color`
* `outline-style`
* `outline-width`

The order of these properties doesn't matter. You can use just one, two, or all three of them.

## For example:

```css
button {
  background: tomato;
  color: white;
  border: none;
}

button:focus {
  outline: blue dotted 5px;
}
```

When you click the button, you will see the blue dotted outline around the button.

{% codepen https://codepen.io/phongduong/pen/KKgPvYO %}


The outline doesn't take up space. It won't affect the layout when it shows up.