teleren/devto huggingface dataset:
How to redirect non-http to https using .htaccess file
Tags: php, http
Published: 2019-11-08 03:37:02

Just put in the .htaccess file

RewriteEngine on

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]


Read More: https://realprogrammer.in/how-to-redirect-non-http-to-https-using-htaccess-file/
Upload a file using PHP
Tags: php
Published: 2019-11-08 03:33:58

First, write your HTML code like this, and don’t forget to add 

enctype="multipart/form-data"
<form action="upload.php" method="post" enctype="multipart/form-data">
  <input type="file" name="fileToUpload" id="fileToUpload">
  <input type="submit" value="Upload Image" name="submit">
</form>

Read More: https://realprogrammer.in/upload-a-file-using-php/
WordPress redirect non-http to https
Tags: wordpress, http
Published: 2019-11-08 03:32:24

Add code within .htaccess


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

Read More: https://realprogrammer.in/wordpress-redirect-non-http-to-https/
How to install a LAMP Web Server with the Amazon Linux AMI
Tags: lamp, aws
Published: 2019-11-08 03:30:04

Step 1: Prepare the LAMP Server

A) Connect with instance

Command:  chmod 400 pemfile_name.pem
          ssh -i "pemfile_name.pem" ec2-user@public_dns
Example:  ssh -i "pemfile_name.pem" ec2-user@ec2-13-233-174-233.ap-south-1.compute.amazonaws.com

B) Now check software is updated 

Command: sudo yum update -y

Read More: https://realprogrammer.in/how-to-install-a-lamp-web-server-with-the-amazon-linux-ami/
Man Pages with Pandoc
Tags: documentation
Published: 2023-01-06 01:50:39

---
title: Man Pages with Pandoc
published: true
date: 2019-11-08 02:42:08 UTC
tags: Documentation
canonical_url: https://brandonrozek.com/blog/manpandoc/
---

[Ethan Martin](https://emar10.dev) recently showed off the Pandoc tool to me. In case you don’t know, Pandoc is a swiss-army knife of markup languages. It allows you to easily convert from one markup language to another.

This got me thinking my love for Markdown as the lowest common denominator for my notes. I can write markdown files for my website, for presentations, and output it into PDF and Word. Of course you don’t get to have the fine control as you do with Latex, but with document classes, you can at least theme it any way you like!

Now to focus this blog post, I do want to share one really cool feature I found out about Pandoc. It can create man pages. I thought of this as a great way to create documentation for a software project. I’ll give you an example to kick things off.

Note: The content is stolen from the `git` man page.

```
---
title: git
section: 1
header: Git Manual
---

# NAME
  git - the stupid content tracker

# SYNOPSIS
  git `[--version] [--help]`

# DESCRIPTION
  Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.

  See **gittutorial** (7) to get started, then see **giteveryday** (7) for a useful minimum set of commands. The **Git User’s Manual** [1] has a more in-depth introduction.

  After you mastered the basic concepts, you can come back to this page to learn what commands Git offers. You can learn more about individual Git commands with "git help command". **gitcli** (7) manual page gives you an overview of the command-line command syntax.

  A formatted and hyperlinked copy of the latest Git documentation can be viewed at **https://git.github.io/htmldocs/git.html**.

# OPTIONS
  --version
    Prints the Git suite version that the git program came from.

  --help
    Prints the synopsis and a list of the most commonly used commands. If the option --all or -a is given then all available commands are printed. If a Git command is named this option will bring up the manual page for that command.

  Other options are available to control how the manual page is displayed. See git-help(1) for more information, because git --help ... is converted internally into git help ....

```

Then execute

```
pandoc -s -t man -o git.1 git.md

```

Here’s what the command means: “Run `pandoc` on standalone mode converting `git.md` into a man page called `git.1`”

To see the results run `man ./git.1`

![1573183066061](https://brandonrozek.com/files/images/blog/1573183066061.png)
Why we need cloud computing?
Tags: cloudcomputing
Published: 2019-11-08 03:29:26

Suppose we don’t have cloud computing and we want to host a website on a server, so what is the step we need to follow?

 1) Buy Stack Server

 2) Think about traffic- How many users are coming daily basis.

 3) Monitoring and Maintenance Server.

Read More: https://realprogrammer.in/why-we-need-cloud-computing/
What is AWS? and the reason for using AWS.
Tags: aws, awsbenifits
Published: 2019-11-08 03:27:34

What is AWS?          

Amazon web service is a platform that offers flexible, reliable, scalable, easy-to-use and cost-effective cloud computing solutions. building blocks can be used to create and deploy any type of application in the cloud.

Reason for selecting AWS:

Read More: https://realprogrammer.in/what-is-aws-and-reason-of-using-aws/
What is AWS Lambda and benefits?
Tags: aws, lambda, mysql
Published: 2019-11-08 03:26:45

Lambda

AWS Lambda you can run your code without provisioning or managing servers. you need to pay charges when your code running only. there is no charges when your code is not running.

With Lambda, Run code virtually without any type of application or backend services. just put your code lambda function will take care about everything.

Benefits of lambda function: 

Read More: https://realprogrammer.in/what-is-aws-lambda-and-benefits/
How To Debug JavaScript Like A Pro.
Tags: javascript, tutorial, beginners, productivity
Published: 2019-11-08 03:04:55

First of all, I want to tell you, yes there are good and bad ways to console.log in [JavaScript](https://buginit.com/category/javascript/) that can make your life easier as a JavaScript developer. So let’s get started on how to debug javascript?

Let’s imagine we have 3 objects to log like below.

```javascript
const foo = { name: 'tom',   age: 30, nervous: false };
const bar = { name: 'dick',  age: 40, nervous: false };
const baz = { name: 'harry', age: 50, nervous: true };
```

### Bad Code 💩

```javascript
console.log(foo);
console.log(bar);
console.log(baz);
```

In the above approach, the problem is we don’t have the variables name to see which one is which? You have to concatenate a string to see which is which. 


### Good Code ✅

But there is a trick called Computed Property Names/property shorthands


```javascript
console.log({ foo, bar, baz });
```

It reduces the code but also shows exactly which variable defines the data.

one line of code.
one console log.
and all the specified information.


### There is more in this tutorial here [To see all examples with results click here](https://buginit.com/javascript/how-to-debug-javascript-like-a-pro/)



Follow for latest updates [Facebook](https://facebook.com/buginit) [Twitter](https://twitter.com/buginit)
What is the tools to make a realtime notification?
Tags: discuss, webdev, notification, help
Published: 2019-11-08 02:55:13

---
title: What is the tools to make a realtime notification?
published: true
description: I need advice to make a realtime notification
tags: #discuss #webdev #notification #help
---

I want to make an app/web app that has a realtime notification the backend will be golang, and the front end will be react/next/react native. But I have no idea to make the realtime notification. I've tried using realtime database firebase, but I think there is another way. Or should I use GraphQL subscription? I need your advice!

Thank you.
Some Fancy Link Hover Effects for Those Special Moments 
Tags: design, css, webdev, html
Published: 2019-11-08 02:21:52

Links are the building blocks of the web, it's how we navigate to new information on the web. With these fancy link effects, you can copy-paste the code from codepen to add similar effects on your webpages. 

#Cartoon Style Link Hover - [Codepen](https://codepen.io/mprquinn/pen/OmOMrR)
![Cartoon Style Link Hover](https://codemyui.com/wp-content/uploads/2019/10/Random-Cartoon-Style-link-hover-effect-with-lines-and-pop-on-hover.gif)


#Reveal Link on Hover - [Codepen](http://codepen.io/abergin/pen/LGuJd/)
![Reveal Link on Hover](https://codemyui.com/wp-content/uploads/2015/08/reveal-link-via-drop-down-on-hover.gif)

#Gradient Underlie on Hover - [Codepen](https://codepen.io/Wking/pen/BdmpVx/)
![Gradient Underlie on Hover](https://codemyui.com/wp-content/uploads/2017/08/gradient-fill-underline-hover-effect-on-multiple-lines.gif)

#Follow My Link - [Codepen](https://codepen.io/bennettfeely/pen/XgMWpX/)
![Follow My Link](https://codemyui.com/wp-content/uploads/2018/01/bouncy-link-hover-follow-effect.gif)

#Marker Link Effect - [Codepen](http://codepen.io/eehayman/pen/WoWzWd/)
![Marker Link Effect](https://codemyui.com/wp-content/uploads/2016/12/marker-pen-highlight-effect-on-hover-click.gif)

#Jump to Link Effect - [Codepen](https://codepen.io/kathykato/pen/RgZrZM/)
![Jump to Link Effect](https://codemyui.com/wp-content/uploads/2017/07/hover-effect-that-jump-between-links.gif)

#Glitch Link Effect - [Codepen](http://codepen.io/origine/pen/qaKkPE/)
![Glitch Link Effect](https://codemyui.com/wp-content/uploads/2016/10/button-text-border-glitch-effect-in-css.gif)

Want more check out the [CSS links effect](https://codemyui.com/tag/link/) gallery on CodeMyUI.
I made a quick and dirty color picker
Published: 2019-11-08 01:17:04

I thought the other color picker websites were too complicated,so I made https://color-picker.net. I personally just use hexcodes for most colors. Also, other color pickers auto generate color schemes, which isn't helpful to me. I was aiming for something really simple, for when I just want a color fast. It was built using javascript and html5.
One SaaS PH Launch a Week...
Tags: opensource, saas, startup
Published: 2019-11-08 01:14:55

Our team at Saasify is busy preparing for our YC interview in a few weeks.

**In order to validate our product, our main objective right now is to launch one fully polished FaaS API every week for the next two months!**

We recently had our first two PH launches for products built on top of Saasify:

- [Puppet Master](https://www.producthunt.com/posts/puppet-master) - Headless chrome as a service.
- [Synopsis](https://www.producthunt.com/posts/synopsis-2) - Summarize any website or article automagically.

These should give you a good idea for the types of SaaS API products we're targeting.

One of the things that I'm most excited about is how **Saasify enables us to launch many product experiments very quickly**. Too many founders put all their eggs into one basket and inevitably fail to find product / market fit, and with Saasify, we're hoping that each of these product launches will teach us about more about our market and what to focus on.

Our thesis is that many of these individual FaaS products will fail to gain traction, but if each one has a certain probability of finding product / market fit, then N independent product launches improves our chances linearly by N, which imho is extremely powerful in the aggregate.

Eventually, these products will all blend into a cohesive marketplace of standardized FaaS, but for now we're focusing on marketing them as standalone SaaS products to optimize messaging and inbound channels.

We have a strong pipeline of projects and OSS authors we're working with to meet our aggressive launch schedule, but we need YOUR help!

**If you have a project you'd like to [saasify and start monetizing](https://saasify.sh/), we'd LOVE to hear from you!**

Feel free to DM me on our [open slack](https://join.slack.com/t/saasify/shared_invite/enQtODAxODA5MzU0NjczLTczOGU3NzNkYTJlMWIwZDkyNjJkOTk3MGEwZThlOWQyNTQxODZjZTExNjAzODJlZDQ3MWM5NWQwMGRiMDcyZTY) && thanks for reading!
Protecting yourself from committing secrets in one line
Tags: git, secrets, scripts
Published: 2019-11-08 01:08:40

There are many times when your project will contain some kind of data that you wouldn't want to end up in git - secrets, passwords, keys, etc. Committing secrets leads to insecure applications and the headache of rotating passwords.

awslabs has a great utility to prevent you from this aptly named [`git-secrets`](https://github.com/awslabs/git-secrets). This project works by using a [git hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) that scans your repository for prohibited patterns on every commit. If something in your codebase matches a given pattern the commit is rejected.

```
» git commit -m "Add password"
password.txt:1:password: ThisIsAPassword

[ERROR] Matched one or more prohibited patterns
```

`git-secrets` has a lot of good information on installing it locally, but there were a few things I felt were missing. I found that my team was slow to adopt this and everyone ended up with a different configuration. Installing it manually for every repo was a chore that I had no intention of doing.

To fill these holes I made [**`git-secrets-installer`**](https://github.com/ahatzz11/git-secrets-installer), a small project that installs `git-secrets` with some smart defaults in one line. 

{% github ahatzz11/git-secrets-installer no-readme %}

To fill the holes of `git-secrets`, the installer does a few things for you:

- Install `git-secrets` on your machine
- Install hooks on all existing local git repositories
- Turn on automatic hook installation on future clones
- Create a default ruleset to match the following patterns:
    
```
(.*)password:
(.*)password=
(.*)secret:
(.*)secret=
```


## Installing

As promised in the title, installation and setup is just one line:

```
git clone https://github.com/ahatzz11/git-secrets-installer && cd git-secrets-installer && chmod +x install-git-secrets.sh && ./install-git-secrets.sh
```

Once installed you will have to restart your terminal. Verify everything worked by running:

```
git secrets --list --global
```

🎉 You are now protected from committing secrets! 🎉

## Useful commands

Add a pattern to the ruleset:

```
git secrets --add --global $textToMatch
```

Add a pattern to the allowed list:

```
git secrets --add --allowed --global $allowedTextOrPattern
```

### More Details

There are a few other pieces worth noting: 
- The patterns that are matched above are case insensitive, so `password` and `PassWord` will both be caught.
- There are some default literals that are allowed, such as `1234567890` and `cassandra`. These are often used as default passwords for tests and other things and should never be used as real passwords because they are not very secure.
- `***REMOVED***` is also an allowed literal, which comes from [bfg](https://rtyley.github.io/bfg-repo-cleaner/) when removing passwords.
How To Learn Anything :: 15 days challenge :: Increase Productivity
Tags: programming, learning, productivity, challenge
Published: 2019-11-08 00:32:19

Hei you! Yes you. From today you are a JavaScript programmer. "Whatttt! How can i be a JavaScript programmer? I barely knows C! Are you mad or something?"
Cool down dude! Take a deep breathe and read this carefully.
Learning anything specially programming isn't hard. But doing something great with that lesson is pretty much hard. You can learn from the internet courses free or paid.
But when it is time for make something good for the real world people get stuck. Working on real product can teach you better than any lesson or degree. So how you will you do it?
Remember this formula when you start learning or building something new make sure you collect enough resources of it. Resources can be blog, forum, websites, repositories etc.
Lean from the blogs or sites and if you get stuck anywhere just ask help on related forum or stackoverflow.
Think your product, Design it, build it and publish it.
Happy Coding! 😁
Share Your Development Experience
Tags: anonymous, discuss, career
Published: 2019-11-08 00:28:15

I am a aspiring software developer. I am a senior in college and am studying IT Software Development. If anyone is interested in replying with answers to the following questions, I was hoping to get some insight into the field. Thanks in advance to anyone that decides to share their experience. 

	How did you get your start in this field?
         

       What’s it like working at your company? 


	What projects are you working on right now?

    
	What is the most rewarding thing about working in this industry? 


	What is the most challenging thing about working in this industry? 


	What experiences, skills, or personality traits does your company look 
        for in new hires?

    
	What job search advice would you give to someone in my situation?
Day 29 : So Hard
Tags: hiphop, code, coding, lifelongdev
Published: 2019-11-08 00:18:08

_liner notes_:
- Professional : Sat in on another talk prep session early this morning. Really good. The talk was about sentiment analysis. Learned a lot. There was also a meeting with some of my teammates about how the month has been going. I worked some more on my application to get it ready to push to GitHub which needs a detailed Readme.

- Personal : Tomorrow is the deadline to sign up for Healthcare in 2020. Man, I spent so much time trying to weigh the different plans available. Why is it so hard! haha. Also started to look into Sapper for my new side project. I'm liking what I see so far. It's basically a framework built with Svelte components. Got to cut things early because I'm going to a show tonight and meet up with some people. Also, going to test out my GoPro Hero Max 360 camera. Oh, I had to return some things back to Amazon today as well. One was a charger for my watch that was making my screen glitch when I used in and other was a stand for my monopod (they shipped me some LED candles, haha).

![Crater Lake, Oregon with mountains and pine trees surrounding a lake](https://thepracticaldev.s3.amazonaws.com/i/ua6u4yhr02ubtpahs9xt.jpg)

Hoping to get the GitHub repo done for the application I made tomorrow. I've got some ideas for the next application I want to build using IoT. Going to finish prepping for the radio show, laundry and mow my lawn.

About to head out.  

Have a great day!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube E-nJEX6li_E %}
How to use .gitignore
Tags: git
Published: 2019-11-08 04:55:11

---
title: How to use .gitignore
published: true
date: 2019-11-08 00:00:00 UTC
tags: git
canonical_url: https://dannypsnl.github.io/docs/how-to-use-gitignore/
---

So what’s wrong with me, write down an article for `.gitignore`. Because this [answer](https://stackoverflow.com/a/58758400/6789898) makes me reconsider how to use `.gitignore`.

The answer tell us it have a better name: `.git-do-not-complain-about-some-files-that-are-untracked-and-do-not-automatically-add-them-in-that-case-but-this-file-has-no-effect-on-files-that-are-tracked`

The origin problem is coming from the asker tracks files that shouldn’t be. How to prevent any out of the expected document won’t be tracked? How can we avoid this happened? We have to ensure every file tracked is because we allowed.

Normally, we add the pattern we don’t want to track into `.gitignore`. However, it can be really annoying, for example, sometimes I use `vim`, sometimes I use `vscode` and sometimes I use Jetbrains products. Unfortunately, `vscode` and Jetbrains would create a folder in your project. And more shit is some `language-server` also do this.

So we want to have a common file to place for it. We can do this:

`git config --global --add core.excludesfile /path/to/common-gitignore`

What’s the problem with this? The problem is how to ensure I do this for every environment? I can do this for my new computer, but can’t do that for my co-worker. And if they are contributors from the internet. That became impossible.

But we still want to do something. So here I suggest we, anyway, whatever, balabalabala, use a wildcard at the top to not track anything and use `!` pattern for those we pretty sure should be tracked.

For example, a Go project can use following:

```
# .gitignore
*
!.gitignore
!*.c
!*.go
!*.sum
!*.mod
!*.md
!Makefile
```

Yes, prevent everything first. And make sure what we want to keep. After we reverse the thought, we pretty sure that every tracked file, of course, is those we want to track.
#30DayMapChallenge: 30 days building maps (1) - ggplot2
Tags: r, rstats, rspatial, ggplot2
Published: 2020-06-09 14:38:04

---
title: #30DayMapChallenge: 30 days building maps (1) - ggplot2
published: true
date: 2019-11-08 00:00:00 UTC
tags: r, rstats, rspatial, ggplot2
canonical_url: https://statnmap.com/2019-11-08-30daymapchallenge-building-maps-1/
---

The #30DayMapChallenge was initiated by Topi Tjukanov on Twitter. This is open to anyone who would like to show a map, whatever the software is. In this blog post, I will show maps made with R. I add constraints to myself for fun. This week, I will use {ggplot2} to create maps.Packages library(dplyr) library(sf) library(raster) library(ggplot2) library(readr) library(tmap) # library(hexbin) ## Customize # Test for font family # extrafont::font\_import(prompt = FALSE) font <- extrafont::choose\_font(c("Nanum Pen", "Lato", "sans")) my\_blue <- "#1e73be" my\_theme <- function(font = "Nanum Pen", .

See more: [#30DayMapChallenge: 30 days building maps (1) - ggplot2](https://statnmap.com/2019-11-08-30daymapchallenge-building-maps-1/)
Opening a Folder and File in Vscode from Terminal
Tags: vscode
Published: 2020-02-16 12:40:13

---
title: Opening a Folder and File in Vscode from Terminal
published: true
date: 2019-11-08 00:00:00 UTC
tags: vscode
canonical_url: https://jagascript.com/opening-a-folder-and-file-in-vscode-from-terminal/
---

[![vscode](https://jagascript.com/static/075e78694a72146a7509186570137664/c739e/vscode.jpg "vscode")](/static/075e78694a72146a7509186570137664/c35de/vscode.jpg)

VSCode offers the `code` command (`code-insiders` for the beta channel) to open files and folders from terminal

these are some possible usage:`code myfile``code a/b/c/d/text.sh``code myFolder`

what if we want to open a folder and also a file within?

use `code path_to_foder --goto path_to_file`
Javascript ghosts
Tags: javascript, frontend, stack
Published: 2019-11-07 23:38:56

This posts follows the one about [call stack obfuscation](https://dev.to/lvidakovic/escaping-the-call-stack-5157). It’s just a proof of concept to further cover the tracks of execution in the browser.

It’s possible to cut off relation of executed code with the script that brought it into execution environment! This may sound abstract. Put in another way, you can hide the script source from the debugger. It’s pretty simple to do:

```javascript
const head = document.querySelector('head')
const evilScript = document.createElement('script')
evilScript.text = `
  const malicious = () => { throw new Error() }
  malicious()
`
head.append(evilScript)
head.removeChild(evilScript)
```

This nifty piece of code creates a script, sets it’s ‘code’, adds it to the head of the document an immediately removes it from the DOM. The code inside the added script will run malicious code for which the origin will seem to be javascript virtual machine(VM) and not originating script tag or external script(if used).

What happens here is that script’s code is pushed to the browser’s memory and starts executing. In the meantime the DOM reference to the script is removed. This seems to unlink the code that will be executed from it’s origin, at least in the debugger’s eyes:

```javascript
VM84:2 Uncaught Error
    at malicious (<anonymous>:2:35)
    at <anonymous>:3:3
    at <anonymous>:7:6
```

Following the stack trace leads to anonymous virtual machine script.