teleren/devto huggingface dataset:
How to fix SPF PermError: too many DNS lookups
Published: 2020-04-12 12:05:59

When troubleshooting email delivery issues, you might run into some cryptic SPF error on the receiving email server along the lines of:

_SPF PermError: too many DNS lookups_

_SPF Permanent Error: too many DNS lookups_

_SPF Fail: too many DNS lookups_

These messages indicate that the SPF record on your domain involves more than 10 DNS lookups which falls foul of the [SPF 10-DNS-lookup limit](https://dmarcly.com/blog/spf-permerror-too-many-dns-lookups-when-spf-record-exceeds-10-dns-lookup-limit) imposed by the [SPF specification](http://emailstuff.org/rfc/4408#section-10.1).

When this happens, SPF returns a PermError indicative of this issue which results in SPF authentication failure. If the final outcome of email authentication is failure, the email message might not land in the inbox.

#### Steps to overcome the SPF PermError: too many DNS lookups issue

Follow the 3 steps below to fix this issue.

##### 1. Go to DMARCLY's Safe SPF feature

[Log in](https://dmarcly.com/login) to DMARCLY's dashboard, then go to DNS Records -> Safe SPF.

##### 2. Set up Safe SPF on your domain

Choose the domain that has an SPF record with 10+ DNS lookups. This is the domain you need to set up Safe SPF on to break free from SPF's 10-DNS-lookup limit.

Click "Set Up Safe SPF". Enter the original SPF record on the domain. Click "Generate Safe SPF Record".

Your original SPF record will be converted to a Safe SPF record, which is a completely valid SPF record that has the same IP addresses as the original one but contains much fewer DNS lookups.

Now publish the generated Safe SPF record on the domain, in the DNS. Then click "Save Safe SPF".

##### 3. Verify that the SPF PermError is fixed

Use an [online SPF record checker](https://dmarcly.com/tools/spf-record-checker) to check the domain, you will see that the DNS lookup count is 1, far below the 10-DNS-lookup limit. Note that DNS propagation takes a while, and if you don't see the new SPF record, retry after 5 minutes.

Now your original SPF record containing 10+ DNS lookups is turned into a Safe SPF record. This Safe SPF record contains exactly the same IP addresses as the original SPF record, while containing DNS lookups far fewer than 10. In addition, whenever any of the services used in your original SPF record changes, the Safe SPF record is updated automatically, so that they are always synchronised.

Now you will never have to worry about the dreaded SPF PermError: too many DNS lookups issue again!

Original post: [https://dmarcly.com/blog/how-to-fix-spf-permerror-too-many-dns-lookups](https://dmarcly.com/blog/how-to-fix-spf-permerror-too-many-dns-lookups)
Some Resources on Mainframes and COBOL
Tags: cobol, mainframes, resources, codenewbie
Published: 2020-04-12 13:50:24

Learning COBOL has been on my bucket list for a number of years now (along with other elder languages). The current pandemic crisis and its stress upon important systems written in COBOL has caused me to take a few more steps in that direction.

In addition to having a soft spot for elder languages I also enjoy curating and compiling information on topics I'm interested in. I've put together two pages - one on [mainframes](https://babyprogrammer.com/mainframes/) and one on [COBOL](https://babyprogrammer.com/cobol/). I'll expand on both as I learn more.

Would love to hear if you have other resources you think are highly valuable on these topics. :)

Best introductory article I've read on the topic thus far is [Bob Reselman's The Beauty of the COBOL Programming Language](https://devops.com/the-beauty-of-the-cobol-programming-language-v2/).

For entertainment value, Jeff Atwood's [COBOL: Everywhere and Nowhere](https://blog.codinghorror.com/cobol-everywhere-and-nowhere/) is enjoyable both for its original humor and in light of our current circumstances.

Stay safe everyone!
🔍 Regex Cheat-Sheet [PDF + Infographic]
Tags: beginners, inthirtyseconds, computerscience, webdev
Published: 2020-04-12 15:10:03

**Regex** is an essential tool in every developer's tool-bag. It helps you perform a search in strings. Regex is used everywhere from compilers to word processors. Yet many developers find it overwhelming to learn. Here's a survey I did on [Twitter](https://twitter.com/godcrampy/status/1249181297551052802):

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

So no one's perfect. Here's a cheat sheet that'll take you a step closer:

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

📁 [Download](https://github.com/godcrampy/cheat-sheets/blob/master/regex/regex-cheatsheet.pdf) the pdf version of this cheatsheet
🌟 All my cheat-sheets are in this [repo](https://github.com/godcrampy/cheat-sheets/) (Star it!)
🚀 Find me on [Instagram](https://www.instagram.com/godcrampy/) | [Github](github.com/godcrampy) | [Twitter](twitter.com/godcrampy) | [Website](sahil.surge.sh)
😄 Have a wonderful day!
Python Zero to Hero - Ep.2 - Python Basics (int, float, str)
Tags: python, tutorial, beginners, video
Published: 2020-04-12 20:56:48

---
title: Python Zero to Hero - Ep.2 - Python Basics (int, float, str)
published: true
description: Today we learnt 3 types of Python objects: Integer (int), Decimal Numbers (float) and Strings (str). With the help of some built-in functions we can write very simple Python programs.
tags: python, tutorial, beginner, video
---
Today we learnt 3 types of Python objects: Integer (int), Decimal Numbers (float) and Strings (str). With the help of some built-in functions we can write very simple Python programs.

You can get the slide deck [here](https://bit.ly/PythonBasics1) and the example code form [GitHub here](https://github.com/Cheukting/python02hero).
Big O for Array Methods
Tags: javascript
Published: 2020-04-12 19:44:31

__Push and Pop__

Adding or removing data to the array using these two operations is always constant.

So this has a BigO of 1 "O()".

__Shift and Unshift__

Shifting and Unshifting always will take its own time. As the array has to reindex itself after doing this. So the complexity increases with the no of items

So this has a BigO of N "O(N)".

__Concat__

Its a simple operation of merging two arrays into one but as we know that indexing takes its own time. So this is also the same as shift.

So this has a BigO of N "O(N)".

__Slice__

Slice returns the copy of an array from starting index to the ending index as the number of elements grows this'll also grow based on the size of the array

So this has a BigO of N "O(N)".


__Splice__

With splice we can insert, remove or modify the elements in an array using index. But at the end we are left with indexing. So even this operation grows with the number of elements

So this has a BigO of N "O(N)".
Help Building Application
Tags: help, angular, firebase, beginners
Published: 2020-04-13 09:25:10

Hello everybody

I created a template for an angular application using firebase for the backend and for the authentication.

Repository : [angular-template-firebase](https://gitlab.com/d-public/angular-template-firebase) 

This template is in development and I still have to add the testing part.

But first I wanted to ask you for help and ask you if you could review the structure, the code and help me improve this project. Because if it can help me in my project, it can help other people in the future to start with a default structure.
 
I created this template after reading [this article](https://dev.to/coly010/building-a-firebase-crud-service-for-angular-2629).

Of course feel free to clone it and use.
Laravel file driven cache on steroids
Tags: php, laravel, linux, cache
Published: 2020-04-18 14:31:20

---
title: Laravel file driven cache on steroids
published: true
date: 2020-04-18 14:26:37 UTC
tags: php,laravel,linux,cache
canonical_url: https://www.medium.com
---

![](https://cdn-images-1.medium.com/max/1024/0*EcKZ2qRhp1zRzgqc)<figcaption>Photo by <a href="https://unsplash.com/@toineprojects?utm_source=medium&amp;utm_medium=referral">toine G</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption>

As of Laravel 7, there are 6 available cache drivers, with APC giving the best results and the file driver being the only one that requires no extra setup.

I was speaking to a friend last night, who mentioned they used Redis as their cache driver. At this point, I have a project that still uses the file driver.

I was thinking I could use some of that sweet performance of memory-driven cache but I really don’t want to install Redis at this time. Right then a solution hit me, something I knew but not really used.  **“tmpfs”.**

```
$ mount -t tmpfs -o size=12m tmpfs storage/framework/cache
```

**What does it do**?

![](https://cdn-images-1.medium.com/max/1024/0*dUHfLTNDw4OIJHUq)<figcaption>Photo by <a href="https://unsplash.com/@liam_1?utm_source=medium&amp;utm_medium=referral">Liam Briese</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption>

**tmpfs:** Allows you to store files in RAM by acting as a directory.

Running the above on a Linux server within your Laravel directory will map your **storage/framework/cache** to your RAM, which means you enjoy the drop in latency of your cached files by using the RAM as opposed to disk IO.

It's a small improvement that can go a long way especially if you use cache a lot within your app.

You can make sure your server switches to RAM storage on restart by putting the command below in your server's system configuration file **/etc/fstab**

```
tmpfs storage/framework/cache tmpfs nodev,nosuid,noexec,nodiratime,size=12m 0 0
```

And to revert back to Disk IO use the command below

```
$ umount storage/framework/cache
```

The End …
Why I'm using Heroku over GitHub Pages
Tags: react, beginners
Published: 2020-04-19 22:48:27

I've been hard at work building an app I've been excited for a long time. Nintendo Switch owners know that sharing Friend Codes isn't the easiest thing to do. You're given a 12 digit number associated with your account. You cannot change it and you *have* to send it to a friend via real life because there is no messaging system. It's ridiculous!

My app, Ninny Code, is written in Python and JavaScript using Flask and React. Visitors can enter their desired username and their Friend code. They're given a URL that they can share with their friends that shows their Friend Code. This way, all they have to remember is their username to get their Friend Code `ninnycode.com/person`.A second URL is given to them to edit their details since there is no user auth within the app—I guess I'll write a blog post on all these details I'm just excited!

Anyways, I decided to host my backend with Heroku and my frontend with GitHub Pages. GitHub Pages was a mistake. From [an issue](https://github.com/facebook/create-react-app/issues/1765) originally posted in 2017, `BrowserRouter`'s behind-the-scenes magic doesn't work well with Pages.

My root page displays perfectly in my deployed app however all of my other routes don't work. So users can sign up but don't have working links to send to their friends. After a full day of troubleshooting, I'm given two choices to bypass the issue: Replace `BrowserRouter` with `HashRouter` or changing one of my lines of code. 

Obviously, my choice was the latter:
```js
- <BrowserRouter>
+ <BrowserRouter basename={process.env.PUBLIC_URL}>
```

This didn't work. I wish it did but it doesn't. My only other choice is using `HashRouter`. But it makes my URLs so gross for the user by prepending `/#` before all of my routes. It's so obtrusive I didn't even want to try!

So, I guess my only other option is to deploy elsewhere. I'm thinking Heroku since that's where the backend is already being hosted. Wish my luck! And if you have a Nintendo Switch and want to give my app a try when I'm done, drop a comment!
Day 2: hover, underline, list-disc, and px-*
Tags: css, todayilearned, 100daysofcode, html
Published: 2020-04-18 23:38:36

I like it when links hovered over are underlined. I learned how to do this in Tailwind CSS today by adding `hover:underline` to `a` tags. Here's an example:

``` html
<a
  class="text-blue-600 hover:underline"
  href="https://dev.to/feldroy/day-2-hover-underline-list-disc-and-px-3apn">
    Day 2: hover, underline, list-disc, and px-*
</a>
```

On my Glitch project, I'm organizing links to my dev.to posts like the one you're reading by putting them in an unordered list. To my surprise, using this code:

``` html
<ul>
  <li>Item 1</li>
  <li>Item 2</li>
</ul>
```

Gave me this result:

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

That almost works. I like my unordered lists to have bullets. The docs told me to use `list-disc` in a class on the `ul` element, so I did. And I got:

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

Hmmm... the bullets appear but they are at the edge of the containing `div`. Then I remembered that Tailwind CSS makes it easy to adjust horizontal padding through the use of the `px-*` classes. After a little experimentation, I settled on `px-6`. This is how it looks now:  

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

And the code for the list:

```html
<ul class="list-disc px-6">
  <li>Item 1</li>
  <li>Item 2</li>
</ul>    
```

Finally I put in my content:

``` html
<ul class="list-disc px-6">
  <li>
    <a 
      class="text-blue-600 hover:underline" 
      href="https://dev.to/feldroy/day-1-building-a-page-after-a-css-reset-1dif">
        Day 1: Building a Page After a CSS Reset
    </a>
  </li>
  <li>
    <a class="text-blue-600 hover:underline" 
       href="https://dev.to/feldroy/day-2-hover-underline-list-disc-and-px-3apn">
         Day 2: hover, underline, list-disc, and px-*
    </a>
  </li>
</ul>
```

Here is [today's code on glitch](https://glitch.com/~tailwindpractice-day-02).
Solution to Leetcode's Contiguous Array
Published: 2020-04-18 23:20:20

This is a medium [Leetcode problem 525](https://leetcode.com/problems/contiguous-array/). See below image for description:

![problem description]
(https://res.cloudinary.com/chunks/image/upload/v1587251961/Chunks%20Blog/Images/contiguous-array_ou9pyc.png)

<h1>ALGORITHM</h1>
1. Create a map that stores the current count to the index.
2. Loop through the array, if the current value is 0, subtract 1 from count. if it is 1, add 1 to count.
3. if the map does not have the current value of count as a key, put the new value in map with key as the current count and the value as the index.
4. if the map has the current count as key, get the maximum between the current max and (index - value of the key).
5. return max.

**CODE**
```
 public int findMaxLength(int[] nums) {
        int count = 0;
        int max = 0;
        HashMap<Integer, Integer> map = new HashMap<>();
        map.put(0, -1);

        for (int i = 0; i < nums.length; i++) {
            if (nums[i] == 0)
                count += -1;
            else
                count += 1;

            if (map.containsKey(count))
                max = Math.max(max, i - map.get(count));
            else
                map.put(count, i);

        }

        return max;
    }
```
Spring Boot : Setup non-web app
Tags: java, springboot
Published: 2020-04-19 07:30:45

If you have `spring-boot-starter-web` in pom.xml

```java
@Slf4j
@SpringBootApplication
public class App implements CommandLineRunner {

    public static void main( String[] args ) {
        SpringApplication springApplication = new SpringApplication(App.class);
        springApplication.setWebApplicationType(WebApplicationType.NONE);
        springApplication.run(args);
    }

    @Override
    public void run(String... args) throws Exception {
        log.info("Hello World");
    }
}
```

If you have `spring-boot-starter` in pom.xml

```java
@Slf4j
@SpringBootApplication
public class App implements CommandLineRunner {

    public static void main( String[] args ) {
        SpringApplication.run(App.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        log.info("Hello World");
    }
}
```
🌍Countdown Timer/Pomodoro (JS + CSS) [YouTube LIVE]
Tags: javascript, tutorial, console, coding
Published: 2020-04-19 13:06:12


⬇️ In this video we will code a countdown timer, similar to Pomodoro clocks. You can schedule your own break, watch the countdown and also the time you have to return, or you can choose time/break by the predefined buttons.

Codepen: https://codepen.io/EleftheriaBatsou
Working project: https://codepen.io/EleftheriaBatsou/pen/bGVeWPP
Video tutorial: https://youtu.be/G7djKBUSiCk

P.S. OMG, I found what was wrong at the end of the video...
check out the first 4 lines of JS, it should be:

let countdown;
const timerDisplay = document.querySelector('.display__time-left');
const endTime = document.querySelector('.display__end-left');
const buttons = document.querySelectorAll('[data-time]');

The inspiration for this project is coming by *javascript30*.

************************************

👋Hello, I' m Eleftheria, an app developer, master student, public speaker, and chocolate lover.

🍩Would you care about buying me a coffee? You can do it here: [paypal.me/eleftheriabatsou](paypal.me/eleftheriabatsou) but If you can't that's ok too!

**************************************

🙏It would be nice to subscribe to my [Youtube](https://www.youtube.com/c/EleftheriaBatsou) channel. It’s free and it helps to create more content.

🌈[Youtube](https://www.youtube.com/c/EleftheriaBatsou) | [Codepen](https://codepen.io/EleftheriaBatsou) | [GitHub](https://github.com/EleftheriaBatsou) | [Twitter](https://twitter.com/BatsouElef) | [Site](http://eleftheriabatsou.com/) | [Instagram](https://www.instagram.com/eleftheriabatsou/)
Pause function execution for a certain time in javascript
Tags: javascript, react, node, productivity
Published: 2020-04-19 15:06:33

*Photo by [NESA by Makers](https://unsplash.com/@nesabymakers?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/code?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)*

Pausing function till one process ends is can be archive in various ways, well for some scenario what if we want to just pause our function for time or I say rest it a little while. how would you do it? 🤔

On the move, I would like to welcome you in a new episode of **Javascript Useful Snippets** where I'll share some shortcodes and function which will help you to make your code much efficient and neat. So, if you haven't read my previous episodes (articles) please check it out [here](https://dev.to/rajnishkatharotiya) or else stay tuned till the end to learn something new 😋 .

Are you familiar with word Promise? If you are not, I recommend the following post to check. *( see you in a bit 🤗 )*

{% post https://dev.to/lydiahallie/javascript-visualized-promises-async-await-5gke %}

Now, I hope you know about the promises. so you'd figured out a way to make the process the waiting until one is not done. But guess you need to pause execution for a certain amount of time by just passing that certain time when you don't have any particular other processes dependent in that function, at those times this **pause()** function will work like charm.

The function needs just time(ms) as parameter argument and in return, it will hold execution for that given a time period. Let me share you a snippet now:-

```
const pause = ms => new Promise(resolve => setTimeout(resolve, ms));

```
Inside a function, I created Promise as mentioned in the above blog *( i hope you have read it )*. and just used resolve callback as setTimeout *(is a method to delay function for a time)* callback and passed time as the second argument of it. So, resolve will trigger after that given amount of time.  

#### How to use pause() function? ####
```
async function work() {
  console.log("Pausing execution for 1 second");
  await pause(1000);
  console.log('Resuming execution');
}
```
Need to create async function, and put pause in await when we call it. So, here i've passed 1000ms inside pause function which will hold execution for one second, as soon as we get success response from our promise it'll move to next execution. 

*Here, if anything goes wrong with the function we have put in await then further execution will be auto terminated so be careful to use. ( you can use try .... catch block in such cases ).*

I was making animation and wanted to add a delay in transition, so I was using setTimeout repeatedly and there I figured to have a function like this to hold my execution for a certain time without hurdles. So, I thought to share it with you too. I hope you learned something, if yes, hit the [follow button](https://dev.to/rajnishkatharotiya) to learn every day 😅
[Webinar] Building CRM tools on No-Code platform DronaHQ
Tags: nocode, webinar, crm, cio
Published: 2020-04-20 06:16:07

[**Watch it here.**] (https://attendee.gotowebinar.com/register/2532254849886575119?source=community)

**Get ready to take your business applications to the next level!** 
 

To counter the dynamic workplace demands, IT leaders will have to trail alternative approaches for application development that allows them to launch quality solutions to market at the fastest pace possible. 

 

**So, what can they do?**

[No-code platforms](https://bit.ly/2wRIh8q) give the ability to create high quality, enterprise-grade applications at a speed that can directly meet the needs of the business.

[DronaHQ](https://bit.ly/2wRIh8q) presents this [Advanced] Webinar to showcase how you can build even the most complex solutions without coding. You don’t need to learn to code or hire engineers to make your next idea a reality. 

DHQ Co-founder will take you through what you can do on the platforms while showcasing a CRM application tailor-made to assist from lead generation to billing. 



[**Link to Webinar: Watch how to build a customizable CRM without coding.**](https://attendee.gotowebinar.com/register/2532254849886575119?source=community)


Creating a high-value application with dynamic screens, multi-tier workflows, process automation, and seamless backend integrations (Connecting to a database, integrating with you favourite applications, Slack, Intercom, Zoom, Email, Calendar and so on).

Think judicious layouts, awesome automation, next-level workflows. You can learn all about it in just a few minutes.

 


[**App in Focus:  Customizable CRM application**](https://attendee.gotowebinar.com/register/2532254849886575119?source=community)

An exhaustive CRM tool that spans from lead to order, order to delivery, and delivery to billing. 

Tune in to see how DHQ Co-founder created this app with commendable CRM functionalities like – 

- Click to call
- Lead enrichment 
- Lead scoring
- Insights Dashboard
- Integration with Zoom 
- Email management with tracking enabled
 


[**Who is the Webinar for?**](https://attendee.gotowebinar.com/register/2532254849886575119?source=community)

CIO, IT Executive, LoB Leader, Consultants, Domain Experts – This Webinar is for you! 

You have great ideas for your business digitization, but the long development cycles make you cringe?

Resource exhaustion in getting basic requirements implemented, getting uncomfortable with heavy coding, server-side logic, custom UI/UX, setting up the app’s backend – database, 3rd party integrations, push notifications, automation. You could hire a developer but how close will that get to what you want and in how much time?  

 
**About the Speaker**
Jinen Dedhia
Co-founder@DronaHQ