teleren/devto huggingface dataset:
Run Laravel scheduled jobs on Heroku
Tags: heroku, herokuscheduler, laravel
Published: 2019-02-21 19:23:59

---
title: Run Laravel scheduled jobs on Heroku
published: true
tags: heroku,heroku-scheduler,laravel
canonical_url: 
---

#### Laravel on Heroku — Tip #3

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

Heroku has the free [Heroku Scheduler](https://elements.heroku.com/addons/scheduler), but this has two disadvantages:

- it runs only every 10 minutes, every hour, or every day
- you have to add your commands in there UI

Laravel comes with an amazing [Task Scheduler](https://laravel.com/docs/scheduling).

To run Laravel scheduled jobs on Heroku you have to add a new command and run that as a process.

Create the Command _app/Console/Commands/SchedulerDaemon.php_:

You can generate this file with:

```
php artisan make:command SchedulerDaemon
```

{% gist https://gist.github.com/sgasser/59a2ee17df0c099ca147e1fc7f1bb51d %}

Add the following line to your _Procfile_:

{% gist https://gist.github.com/sgasser/9e902f42c5b92c47892b3393662b4943 %}

Don’t forget to enable this process in the Heroku Dashboard:

![](https://cdn-images-1.medium.com/max/1024/1*kHi_1kh82c0cWpUrJZOZMw.png)<figcaption>Enable this process in the Heroku Dashboard</figcaption>

### Drop Me a Line

Thanks for reading! Say hi to me on [Twitter](https://twitter.com/DynoTower) and check out our [Heroku Addon](https://elements.heroku.com/addons/dynotower-start-stop) to save money by automatically shutting down your non-critical dynos.
Dockerize a Sinatra Microservice
Tags: ruby, docker, devops
Published: 2019-02-18 11:57:20

---
title: Dockerize a Sinatra Microservice
published: true
description: How to package your Sinatra Ruby app in a Docker container.
tags: ruby, docker, devops
cover_image: https://thepracticaldev.s3.amazonaws.com/i/eddu1kbcofxbbqsmt711.jpg
---

[Sinatra](http://sinatrarb.com) is a lean and fun framework to build simple web apps and microservices in Ruby. Traditionally developers would deploy to a platform like Heroku or self-managed server. But what if your team is working in more than one language and need a uniform way of deploying things to the cloud? This is, of course, a great use case for Docker.

Let's say your Sinatra app has a simple structure:

```
.
├── Gemfile
├── Gemfile.lock
├── README.md
├── app.rb
├── config.ru
└── spec
    ├── app_spec.rb
    └── spec_helper.rb
```

To package it in Docker, create a `Dockerfile`:

```
FROM ruby:2.5

RUN apt-get update -qq && apt-get install -y build-essential

ENV APP_HOME /app
RUN mkdir $APP_HOME
WORKDIR $APP_HOME

ADD Gemfile* $APP_HOME/
RUN bundle install --without development test

ADD . $APP_HOME

EXPOSE 4567

CMD ["bundle", "exec", "rackup", "--host", "0.0.0.0", "-p", "4567"]
```

Note the `RUN bundle install --without development test` line. I'm assuming that you're building a container for deployment purposes, and we don't need our development dependencies for that.

In case you want to run all development tasks and tests in Docker, you have two options:

1. Bundle everything and live with a slightly bloated container image in production
2. Create a `Dockerfile.dev` and use that for development and testing before building a production image with `Dockerfile`.

Either way, you can build and run the container locally:

```
$ docker build -t sinatra-demo .
$ docker run-p 80:4567 sinatra-demo
$ curl localhost
> hello world
```

That's great, now we have our app running in a standard container.

How can we deploy it? The best platform to run Docker containers today is Kubernetes. For a detailed tutorial on deployment, see my other post:

{% link https://dev.to/markoa/cicd-for-microservices-on-digitalocean-kubernetes-1dg1 %}
What Magento 2’s Latest Version Has to Offer?
Tags: magento2, version, magento
Published: 2019-02-18 11:51:18

---
title: What Magento 2’s Latest Version Has to Offer?
published: true
description: Stop wondering what are the new features of Magento 2 or how good is the latest version of Magento 2 and experience it for yourself and see the difference.
tags: magento2,version,magento    
---

When it comes to e-commerce, none other than Magento 2 comes to the mind and why not as it has taken the ecommerce development to a completely whole new level with its magnificent abilities. The features of Magento has always surprised and now with its latest updates, the list of Magento 2's features have gone far to a great extent. And today, we are going to take a tour of it.

What Are The Magento 2 Features?

We already have enjoyed the new file structure, optimized performance, improved flexibility, jQuery library and the addition of new inbuilt technologies in Magento 2 and now, with the latest addition to the Magento family - Magento 2.3, the possibilities have increased further.

Magento 2 New Features List

A brand new admin panel with simplified navigation of tools and that can be personalised to each user.

New admin security which means only one person can be logged in per admin user account.

Responsive and has touch-friendly navigation. With its drag-and-drop layout editing, you can edit your online store as you want within a few minutes of time.

New and improved product section with new options for user notifications
Increased customisation options for the ‘Sales – Order grid’ page and the ‘Products – Catalog’ grid page.

Excellent M2 Filters that are great for organising the results on the page and to look at a specific subset of products or orders. Using which, you can also analyse data and monitor to keep track of customer behaviour on your store.

Less complicated checkout processes. The quicker checkout process greatly helps in increasing conversion rates for store owners.

Safe and secure payment methods. Popular extensions such as payment gateways like PayPal and Braintree for stores better functionality.

Now that you got a bit hold of Magento 2 feature list, let’s take a look at Magento 2’s latest version - 2.3

Continue Read [Magento 2 Features and Latest Version](https://www.mageants.com/blog/magento-2-feature-list-and-latest-version.html)
Cross Browser Testing with LambdaTest
Tags: testing, beginners, webdev
Published: 2019-02-18 09:34:56

---
title: Cross Browser Testing with LambdaTest
published: true
description: Your web app, website are just more than a site,they are crucial face of your business in generating revenue. So it's very important to ensure that your web app give seamless user experience across all platforms.
tags: #testing #beginners #webdev
---

Your web app, website are just more than a site, they are crucial face of your business in generating revenue. 

So it's very important to ensure that your web app give seamless user experience across all platforms

On premise infrastructure setup would mean , that you would have to buy ,and setup multiple computers and latest mobile devices for testing - all of them

Or you can use LambdaTest.

With [LambdaTest](https://goo.gl/g9Bh3S), in less than 30 seconds you can start testing your web apps across browsers, devices, and different resolutions right from your own computer, with no time and money wasted on creating your own infrastructure,

 All with a single click.

In other words it works! put LambdaTest to work for your cross browser testing. Sign up for your freemium plan to experience the platform.

Kick start testing your webapp, webpage or online store with LambdaTest here! https://goo.gl/g9Bh3S
Automation Testing With Selenium and Node.JS
Tags: node, testing, javascript, webdev
Published: 2019-02-18 09:23:26

---
title: Automation Testing With Selenium and Node.JS
published: true
description: Cross browser testing is a practice to test a website or web-app across different browsers, devices and operating systems.
tags: #nodejs #testing #javascript #webdev 
---

{% youtube 6XbgNXcLUSE %}
Cross browser testing is a practice to test a website or web-app across different browsers, devices and operating systems. To experience automation testing through an open-source platform is always blissful, especially when we refer to the practice of cross browser testing where test cases are found in plethora.
If you are not aware of Selenium, it is one of the most renowned open-source, test automation framework developed by Thoughtworks to facilitate automated cross browser testing with ease.

Visit LambdaTest to try their Selenium grid now -  https://goo.gl/kKXhSR

Tools for running automation:
https://nodejs.org/en/download/
http://chromedriver.chromium.org/download
https://github.com/mozilla/geckodriver/releases
https://github.com/LambdaTest/nodejs-selenium-sample
Automation Testing With Selenium and Node.JS
Tags: node, javascript, testing, webdev
Published: 2019-02-18 09:13:06

---
title: Automation Testing With Selenium and Node.JS
published: true
description: Cross browser testing is a practice to test a website or web-app across different browsers, devices and operating systems.  
tags: #nodejs #javascript #testing #webdev  
---

{% youtube 6XbgNXcLUSE %}
Cross browser testing is a practice to test a website or web-app across different browsers, devices and operating systems. To experience automation testing through an open-source platform is always blissful, especially when we refer to the practice of cross browser testing where test cases are found in plethora.
If you are not aware of Selenium, it is one of the most renowned open-source, test automation framework developed by Thoughtworks to facilitate automated cross browser testing with ease.

Visit LambdaTest to try their Selenium grid now -  https://goo.gl/3NgmHX

Tools for running automation:
https://nodejs.org/en/download/
http://chromedriver.chromium.org/download
https://github.com/mozilla/geckodriver/releases
https://github.com/LambdaTest/nodejs-selenium-sample
Life Update: I’m Officially a Developer
Tags: career, lifeupdate
Published: 2018-12-10 01:55:53

---
title: Life Update: I’m Officially a Developer
published: true
description: Quick update on where I've been
tags: #career #lifeupdate
---

It’s been awhile. I promise my absence has been for good reason though, not because I fell off the coding wagon. Actually, quite the opposite. As the title says, I got a freakin’ job as a web application developer! I was hired on back in September and have been there for about 3 months now. Since then coding has been apart of my daily life more than ever before so my blog updates have sort of taken a back seat. 

I do apologize about the long hiatus though. From the interviewing process (which was quite brutal for someone of my novice skill level) to the job itself , life has been super draining. Don’t get me wrong, I’m learning loads of stuff each and every day but I now know this is where the real journey starts. Getting the job was just the beginning.

I definitely intend to give a full recap about the interview, personal struggles, how I overcame certain obstacles and ultimately landed the job but in the mean time I wanted to let everyone know that I’m alive and doing well. Until next time, happy coding!

_Originally published [on my blog](https://www.bennettdungan.com/2018/12/10/life-update-im-officially-a-developer/)_
Novices guide to Dependency Injection & Dagger2 - Part 1 - Introduction
Tags: android, dagger, beginners
Published: 2019-02-18 08:41:25

This guide is an attempt to convert the difficult to understand concept of Dependency Injection into a language which is easier to understand and comprehend. This article draws all the wisdom from hundred's of sources I read to wrap my head around this concept and from using it in production application.

##Defining Dependency Injection (DI)##

In very simple terms, *DI is trying to segregate the dependency creation and dependency calling*. 

Let me explain.

Dependency is any class or object that is required and is not available in the current scope. It could be a platform level class like `Toast`, a 3rd party library like `Retrofit` or your own class defined somewhere else in the project. Currently, every time you require any of these 'dependencies', you try to create its object using the `new` operator. Alternatively, you may try to use some design pattern like Singleton or Factory to call upon a preexisting object of the required dependency. 
```java
class User {
   private ProfessionalDetails pDetails = new ProfessionalDetails();
   private AcademeicDetails aDetails = new AcademicDetails();
}
```

*But now let me ask you to change the way you do things a little differently*. Instead of creating or accessing your dependencies directly, how about I tell you that all the dependencies you ever require are always provided to you via the method parameters and you never have to create a new object yourself. The above code will then look something like this:
```java
class User {
   private ProfessionalDetails pDetails;
   private AcademeicDetails aDetails;
   
   /* Example of Method (Dependency)Injection */
   public void userDetails(ProfessionalDetails pDetails, AcademicDetails aDetails){
      this.pDetails = pDetails;
      this.aDetails = aDetails;    
   }
}
```

This is called **Method  (Dependency)Injection**.

As we defined DI earlier as segregating the dependency creation and calling, here, you are not worried where or how the dependency is created, you are just concerned with using them. Similarly if any dependency you require at Class level is provided to you via the class constructor like shown below, it's called **Constructor Dependency Injection**.

Now as a first step, I implore all of my readers to stay with this thinking of not creating new dependency objects and to get the dependencies via method or constructor injection. And to take things a little further, if I can ask you reduce the use of class variables in your methods and try to pass the requirements via method parameters. This is something which will be useful when we look at the larger picture of testable code but more on that later.
Is it really easy for black hat hackers to inject codes into a website?
Tags: beginners, websecurity, advice, help
Published: 2019-02-18 08:01:46

---
title: Is it really easy for black hat hackers to inject codes into a website?
published: true
description: Coming to realize that I've been offering web design/development services to friends and online, I don't have a clear picture of how to secure a website aside from the HTTPS and SSL Certificate.
tags: beginner, websecurity, advice, help
---
![](https://thepracticaldev.s3.amazonaws.com/i/txu8ux6z0ihjvq6uic5w.jpg)

I use Netlify & AWS Free Tier for hosting.

How easy is it for black hat hackers to inject malicious codes into a website?

Coming to realize that I've been offering web design/development services to friends and online, I still don't have a clear picture of how to secure a website aside from the HTTPS and SSL Certificate. 

Any advice for a beginner?

Thanks!
Reference Error: JavaScript
Tags: javascript, webdev, beginners, testing
Published: 2019-02-18 07:56:39

---
title: Reference Error: JavaScript
published: true
description: Errors about undeclared variable assignments occur in strict mode code only. In non-strict code, they are silently ignored.
tags: #javascript #webdev #beginners #testing
cover_image: https://www.lambdatest.com/blog/wp-content/uploads/2018/04/JPG-1.jpg 
canonical_url: https://www.lambdatest.com/blog/reference-error-javascript/
---

How does it feel when you go to give a job interview and after reaching the interview location you find out that the company for which you are here doesn’t even exist.

Obviously you got angry and your mind will start throwing negative thoughts.

Exactly same happens with JavaScript too.

When any value is assigned to undeclared variable or assignment without the var keyword or variable is not in your current scope, it might lead to unexpected results and that’s why JavaScript presents a `ReferenceError: assignment to undeclared variable "x"` in strict mode. And this error causes a problem in execution of functions.

If you’ve begun to try out JavaScript you might have encountered some pretty baffling errors. I know I sure did…

##ReferenceError: assignment to undeclared variable “x”##
Errors about undeclared variable assignments occur in strict mode code only. In non-strict code, they are silently ignored.
**Code without ‘var’ keyword**
```
function foo() { 
  'use strict'; 
  bar = true; //variable not declared
} 
foo();
```
What you get after executing above program?? An Error?? 🙁

![](https://www.lambdatest.com/blog/wp-content/uploads/2018/04/re.png)

**How do you need to code**🙂
Insert ‘var’ in front of your variable and see your program running
```
function foo() {
  'use strict';
  var bar = true; //declared variable here
}
foo();
```

Likewise there are many scripting factors possible to generate reference error in javascript.

`ReferenceError: "x" is not defined`
`ReferenceError: deprecated caller or arguments usage`
`ReferenceError: can't access lexical declaration`X' before initialization`
`ReferenceError: reference to undefined property "x"`
`ReferenceError: invalid assignment left-hand side`


[![](https://www.lambdatest.com/blog/wp-content/uploads/2018/11/Adword-Cyber2.jpg)](https://goo.gl/aSD1f7)

Original Source: [lambdatest.com](https://goo.gl/xPw5ts)

**Related Articles**
1. [Unknown: Script Error in JavaScript](https://goo.gl/J9JBC8)
2. [Uncaught RangeError: Maximum call stack in JavaScript](https://goo.gl/gHzewv)
3. [Debugging JavaScript Using the Browser’s Developer Console](https://goo.gl/UJrxR2)
How to Find Metadata Signatures in Image Files using C# .NET API
Tags: net, api, esigning, groupdocs
Published: 2019-02-18 06:42:49

---
title: How to Find Metadata Signatures in Image Files using C# .NET API
published: true
description: post
tags: .NET, API, esigning, groupdocs
---

This article covers a brief introduction about the e-signing process; the benefits gained by end users together with a reference to one of the well-known document eSigning APIs for .NET platform. 

Electronic signing or e-signing is the procedure of signing your legal, contractual or any other type of documents digitally, without the need to scan or print them. e-Signing helps in reducing the hassle of obtaining hard copies, processing and storing them, together with providing an avenue towards a paper-less environment. 

Let’s talk about at which levels is eSigning process required. Is it exclusive to certain departments, businesses or individuals? No, this process has a very broad scope; one might implement it at a personal or enterprise level too. 

We can now look at how you can actually eSign your documents. Whether it is a manual or automated procedure? There are no hard and fast rules, individuals can add e-Signatures into their files manually or, there could be an automated approach for batch processing. If you are a programmer and would like to code an app on .NET platform which lets you digitally sign numerous types of files, you can consider using GroupDocs.Signature for .NET API. It supports adding text, image, digital, barcode, QR-code and metadata type signatures into PDF, Microsoft Word, Excel, PowerPoint, Text, JPEG and TIFF files proficiently. 

Latest release of this .NET API comes with an interesting feature of searching for metadata signatures inside your .NET based image file formats. Feel free to checkout available features yourself – http://bit.ly/2TRzEAW

Follow GroupDocs on YouTube – http://bit.ly/2PwqUNK
ui-form-field - A simpler way to work with Forms in React
Tags: javascript, react
Published: 2019-02-18 06:28:09

---
title: ui-form-field - A simpler way to work with Forms in React
published: true
description: 
cover_image: https://github.com/ngduc/ui-form-field/raw/master/screenshot-types.png
tags: #javascript #react
---

`ui-form-field` is my attempt to address complicate form rendering in React. It is being used actively in many projects with positive feedbacks from engineers.

Features:
- Render different form layouts: Bootstrap 4, Semantic UI, Spectre and more. (including horizontal layout, inline fields)
- Compatible with formik. This is built on top of formik and can be used together with it (for custom fields, etc.)
- Support popular and advanced field types: react-select, multi-select, tag input with auto-complete, etc.
- Simplify complicate use cases like: Dynamic (conditional) field rendering, mixing with other components within the form, custom fields.
- Works well on mobile screens.

```
import { FormContainer, Form, Field, Button } from 'ui-form-field';

<FormContainer onSubmit={this.onSubmit} render={props => (
  <Form use="bootstrap4">
    <Field label="Text" name="text" />
    <Field name="password" />
    <Field textarea name="textarea" />
    <Field select options={animals} name="select" />
    <Field radios options={genders} name="radio" />
    <Field checkboxes options={roles} name="checkboxes" />
    <Field checkbox name="singleCheckbox" />
    <Field singleSelect options={animals} name="singleSelect" />
    <Field multiSelect options={animals} name="multiSelect" />
    <Field tagSelect name="tags" options={tags} />
    <Field number name="number" />
    <Field date name="date" />
    <Field time name="time" />
    <Field toggle inline name="toggle" />
    <Field file label="File Upload" name="file1" />
    <Field file withPreview label="File Upload (with Preview)" name="file2" />
    <Field range name="range" />

    <Button type="submit"/>
    <Button>Cancel</Button>
  </Form>
)} />
```

Result: (Full form, with validation (with yup) & error messages)

![Example](https://github.com/ngduc/ui-form-field/raw/master/screenshot-types.png)

[Demo](https://codesandbox.io/s/on50k50wy)
[Github](https://github.com/ngduc/ui-form-field)

I appreciate any feedbacks, suggestions or ideas below. Thanks! :)
Cute - CSS in JS: https://bmarkov.github.io/cute-css/
Tags: css, javascript, cssinjs
Published: 2019-02-18 05:57:25

---
title: Cute - CSS in JS: https://bmarkov.github.io/cute-css/
published: true
description: https://bmarkov.github.io/cute-css/
tags: css, js, css-in-js 
---
Utilising tagged template literals and the power of CSS.
Automatic CSS - adds css to a web page on demand, fully automatically. Your users load the least amount of code necessary.
No class name bugs - unique class names for your styles. You never have to worry about duplication or misspellings.
Removes the mapping between components and styles
FREE
Custom Elements: https://www.htmlelements.com/
Tags: customelemements, webcomponents, javascript
Published: 2019-02-18 05:18:33

---
title: Custom Elements: https://www.htmlelements.com/
published: true
description: Best Framework for Custom Elements Development with multiple Free Components
tags: custom elemements, web components, javascript
---

Vanilla JS and ES6 library and next-generation front-end framework: https://www.htmlelements.com/
Ideal for the new Web Apps. Automatically adapts to different device types.
0 dependencies. 0 learning curve.
-Javascript library that helps you to create Custom UI Elements.
-Integrates with Angular, ReactJS, Vue.js and any other framework.
Arbitrary-precision arithmetic and Math functions.
DateTime precision up to a yoctosecond (10⁻²⁴ second).
Share the fullstack common interview questions
Tags: discuss, interviewquestions, 10secondsofcode, fullstack
Published: 2019-02-18 05:02:46

---
title: Share the fullstack common interview questions
published: true
tags: discuss, #interviewquestions, #10secondsofcode, #fullstack
---

Anyone share common interview questions for fullstack developer [MERN, MEAN].

## HTML5

## CSS3

## JAVASCRIPT [ES5 & ES6]

## REACTJS

## ANFULARJS

## NODE

## MONGO