teleren/devto huggingface dataset:
Boogie-bot
Tags: swift, beginners, webdev
Published: 2020-02-04 00:57:07

1. You created combinations of dance moves by assembling various move functions inside functions of your own. To make a working dance routine, did you need to understand how each move function worked or just what it did?

   A- I like to know both, first I see what the function does then I dissect it. 

2. Did you wish that there were more moves available or that you could add your own moves?

   A- Yes, and I know that we'll learn ho to do it on our own.

3. What would a function that made BoogieBot do multiple moves at the same time look like?

   A- Its chaos but funny.
Python PipEnv 101
Tags: python, pipenv, spanish
Published: 2020-02-04 00:49:24

---
title: Python PipEnv 101
published: true
description: Gestión de dependencias y entorno virtual para Python.
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/w5ajjkqmwfos15ub2pks.jpg
tags: #python #pipenv #spanish
---

Bienvenidos a mi primer post en dev.to!

Acabo de publicar mi primer video en mi canal de Youtube y quiero compartirlo con toda la comunidad #spanish. Tengo planeado hablar sobre AWS, Aplicaciones Serverless, Contenedores, Gitlab y CI/CD.

Que lo disfruten...

## Descripción

Gestionar las dependencias en proyectos Python puede resultar problemático algunas veces. En especial cuando se busca implementar algún tipo de automatización o si tu aplicación se desplegará/deployara en otro entorno distinto del que usaste para desarrollarla.

PipEnv intenta traer lo mejor del mundo del packaging (bundler, npm, composer, yarn) al mundo Python. Brinda gestión de dependencias y entornos virtuales en una sola solución.

En este video te presentaré esta herramienta, veremos cómo se usa y analizaremos algunos casos de uso en la vida real. Todo esto, como siempre, desde un punto de vista DevSecOps.

{% youtube NkQCYbDvkRU %}
a hundred players
Tags: node, sveltejs, fastify, pushercom
Published: 2020-04-26 22:21:53

---
title: a hundred players
published: true
date: 2020-02-04 00:00:00 UTC
tags: node,svelte.js,fastify,pusher.com
canonical_url: 
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/h6aghct5l45g0petnork.png
---

This is a talk I gave at [London Node User Group (LNUG)](https://lnug.org) in November 2019. The multiplayer live audience game was an idea I'd had brewing for a while - ever since I was writing little mini games with Flash and building some museum exhibitions in the early 2000s. I was reading a lot at the time about game design and an anecdote I read told a story about a game of Pong for large audiences, with collective energy and excitement of the auditorium where everyone was playing the same game. I wanted to do _that_.

My initial intention was to one day recreate the Pong experience via a local network and phones as controllers. But it was the opportunity to showcase technology from [Pusher](https://pusher.com), one of our meetup sponsors, was the spark that got me to do it...

{% youtube -WDiQJ0zqNE %}

All the source code to the game is in [this GitHub repo](https://github.com/admataz/hundred-players)
How to Change Last Commit in Git
Tags: git, vsc, linux, unix
Published: 2020-05-05 16:46:39

---
title: How to Change Last Commit in Git
published: true
date: 2020-02-04 00:00:00 UTC
tags: git, vsc, linux, unix
canonical_url: https://tech.serhatteker.com/post/2020-02/change-last-commit/
---

This happens to me if I commit, then run tests or code formatter.  Or sometimes I forgot to add some files since I don't use usual `git add .` command. I rather to add files one by one explicitly.

So how can we change the history? The last commit history?

## Add File(s)
You forgot to add a file, or files into your commit and you want to add them. It
is easy:

```bash
$ git add <your_forgotten_file>
# or add all files
$ git add .
$ git commit --amend --no-edit
```

If you want to change your commit message as well:

```bash
$ git commit --amend
```

This will open your last commit with your editor of choice for git:

```bash
$ git config --list

core.editor = nvim
```

Edit this commit message and then save it.

## Change Commit Message
As shown above; if you just want to change your most recent commit message, just run:

```bash
$ git commit --amend
```
Or in one line:

```bash
$ git commit --amend -m <new_commit_message>
```

Now your last commit contains that change!

__Warning__:
> You should never amend commits that have been pushed up to a "public" branch! Only amend commits that only exist in your "local" or notice people about this   change.

All done!
Laravel whereRaw Example
Published: 2020-02-05 12:13:44

---
title: Laravel whereRaw Example
published: true
date: 2020-02-04 00:00:00 UTC
tags: 
canonical_url: 
---

Here i will show you laravel db raw where clause step by step explain laravel whereraw example if you want to see example of laravel whereraw dateformat then you are a right place Here you will learn laravel eloquent whereraw Follow bellow tutorial step of laravel eloquent where db rawI wi
Configure entity framework with dependency injection
Tags: dotnet, entityframework, aspcore
Published: 2020-02-03 23:25:41

## Problem

You're following the configuration options pattern. To configure an entity framework context, you need to inject an IOptions container. But during ConfigureServices, the dependency injection container isn't ready.

## Is this useful to me?

Should be relevant to at least asp core 2.2 and 3.x.

## Solution

Entity framework lets you provide a context factory. The factory is defined during ConfigureServices, but it's only used after. Use the overload with a callback that includes an IServiceProvider. The IServiceProvider gives access to the DI container, so you can access any IOptions.

    public void ConfigureServices(IServiceCollection services)
    {
      services.Configure<DatabaseSettings>(o =>
      {
        o.Database = "some db";
        o.Username = "some user";
        o.Password = "some password";
      });

      services.AddDbContextPool<MyDbContext>((IServiceProvider sp, DbContextOptionsBuilder builder) =>
      {
        var dbsettings = sp.GetRequiredService<IOptions<DatabaseSettings>>();
        var env = sp.GetRequiredService<IWebHostEnvironment>();
        builder.UseNpgsql(dbsettings.Value.GetConnectionString());
        builder.EnableSensitiveDataLogging(env.IsDevelopment());
      });
    }

    public class DatabaseSettings
    {
      public string Database { get; set; }
      public string Username { get; set; }
      public string Password { get; set; }
      public string GetConnectionString() => new NpgsqlConnectionStringBuilder
      {
        // ...
      }.ConnectionString;
    }

For this to work, your context must have a single constructor. That constructor must accept a DbContextOptions object:

    public class MyDbContext : DbContext
    {
      // ...

      public MyDbContext(DbContextOptions options) : base(options) { }
    }

You can override OnConfiguring if you like, the docs say:

> If both are used, OnConfiguring is applied last and can overwrite options supplied to the constructor argument.

## Can I use IConfigureOptions?

No.

Lots of things need to be configured inside ConfigureServices, but also need IOptions. Entity framework uses a factory callback pattern. Another pattern asp core uses is IConfigureOptions. Ef core 3.1 does not use the IConfigureOptions pattern.

## Further reading

- https://docs.microsoft.com/en-us/ef/core/miscellaneous/configuring-dbcontext#using-dbcontext-with-dependency-injection
- https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-3.1
- https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options?view=aspnetcore-3.1
Good things I've read recently here
Tags: bestofdev, gratitude
Published: 2020-02-03 23:14:35

I am procrastinating hard on writing new articles here. I believe in [structured procrastination](http://www.structuredprocrastination.com/) so I can apply this principle here? 

Yes! Instead of writing myself, I will talk about the _good things I've read recently here_.

----

If you like to write tech articles, could you maybe like even more to be paid for writing tech articles? Check out this post from @hyvortalk

{% link https://dev.to/hyvortalk/10-companies-that-you-can-write-for-and-get-paid-as-a-developer-100-per-article-4dd7 %}


How to do a presentation that is interesting? @n_mehlhorn invite us to learn the art of story telling. This is an article I will need to read and re-read again.

{% link https://dev.to/n_mehlhorn/how-to-make-interesting-presentations-for-software-projects-1n1m %}

Did you know that you can use Dev listings to search for a remote job? Read @peter for more details.

{% link https://dev.to/peter/remote-positions-currently-live-on-dev-listings-2ohg %}

Erik Ditrick from @daedtech explain you how you to do a resume correctly. Not the usual advice. 

{% link https://dev.to/daedtech/resume-skills-for-the-developer-with-upward-ambition-431a %}



If you want to impress your friends with your Kotlin skills, I recommend reading @ahmedrizwan opening a magic box: How do DSL work in Kotlin? Hint: there is no magic.

{% link https://dev.to/ahmedrizwan/quick-recipe-for-creating-dsls-in-kotlin-1f40 %}

If you are bored implementing quicksort and factorial, and are looking for something more realistic, @renegadecoder94 has 71 Python snippets that solve real world problems

{% link https://dev.to/renegadecoder94/71-python-code-snippets-for-everyday-problems-1mep %}
Creating a simple TODO service with Actix (Video) - Part 1
Tags: rust, webdev, microservices, tutorial
Published: 2020-02-03 23:14:31

# Trying out the FASTEST web framework in 2020 (Video)

[![Creating a simple TODO service with Actix](https://img.youtube.com/vi/gQwA0g0NNSI/0.jpg)](https://www.youtube.com/watch?v=gQwA0g0NNSI)
What's the best Java book?
Tags: java, books, python, help
Published: 2020-02-03 23:12:56

I'm looking for something along the lines of "Python Crash Course" and "Automate the boring stuff with Python", but for Java.


*Not a reference material book such as "java the complete reference" by Herbert Schildt, but a book that takes you from start to finish?

I've read countless post recommending different books, mainly a few 2-3 ones are quite popular.

What's your opinion/story?
HOW TO CREATE OBJECTS IN JAVASCRIPT
Tags: javascript, object, oop, beginners
Published: 2020-02-03 22:01:46

# objects

## creating an object

**Using Object litteral**

this is the simplest way of creating a javascript object
you simply create a variable an assign it to an object with specified properties

```javascript
const person = {
  name: "salah",
  age: 22
};
```

**using constructors**

constructor are methods that creates an instate object based on given values passed as parameters,
the properties of that object are spercifed in the method implementation .
here we define our constructor:

```javascript
function Person(name_, age_) {
    this.name = name_;
    this.age = age_;
    this.Greeting = function () {
        console.log("hi, My name is " + this.name);
    }
}
```

and now we only initialize a new instance of Person
let salah = new Person("salah", 25);
so here we can access our objects promerties and methods

```javascript
salah.Greeting();
console.log(salah.age);
console.log(salah.name);
```

**using factory functions**

```javascript
var personFF = function(name_, age_) {
  return {
    name_,
    age_
//we can add methods and properties here
  };
};
var khalid = personFF("khalid", 15);
console.log(khalid);
```

**using the Object.clone() method**

to clone an object is another choice we have.
this method takes one or more objets as parameters and then creates a new object based o what's given

```javascript
var hamza = Object.assign(khalid);
hamza.name_ = "hamza";
```

as we can see the assign method copies the values of an object by reference.
so when we changed the second object's property name the first object's property changed to and vise-versa.

```javascript
console.log(hamza);
console.log(khalid);
```

same thing if we try to change the age property

```javascript
khalid.age_ = 33;
console.log(hamza);
console.log(khalid);
```

so now both objects are referncing the same memory adress
to prevent this problem we can use the spread operator
**using the spread operator**

```javascript
var ayoube = {
  ...khalid // this ... is called the spread operator it basically spreads an object's properties into another object
};

console.log(ayoube);
ayoube.name_ = "ayoube";
```

so now even if we change the second object the first object stays the same and vise versa.

```javascript
console.log(ayoube);
console.log(khalid);
```

**using the create method**
a better way to prevent this problem is the create method
it creates an empty object based on an exesting object's properties.

```javascript
var khalil = Object.create(khalid);
console.log(khalil);
console.log(khalid);
```

so now we have an object called khalil that has the same properties as khalid (name* and age*)
but the with no values yet.

```javascript
khalil.name_ = "khalil";
khalil.age_ = 25;
console.log(khalil);
console.log(khalid);
```
How to Configure Custom Domain Name (DNS) to Azure Web App
Tags: azure, dns
Published: 2020-02-03 22:01:21

In this [tutorial](https://github.com/patricksameerajayalath/AzureTutorials/blob/master/How%20to%20Configure%20Custom%20Domain%20Name%20(DNS)%20to%20Azure%20Web%20App.pdf) I’m going to show how to:

•	Create an ASP.NET Core MVC Application and Publish to Azure
•	Create/Purchase a Custom Domain from a Custom Domain Provider
•	Configure Custom Domain on Azure



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


You can find the PDF version of this tutorial [here](https://github.com/patricksameerajayalath/AzureTutorials/blob/master/How%20to%20Configure%20Custom%20Domain%20Name%20(DNS)%20to%20Azure%20Web%20App.pdf).

You can find all my Azure/.Net tutorials [here](https://dev.to/patricksameerajayalath) and [here](http://sameerajayalath.blogspot.com/).

Enjoy !!
What is the best bootcamp (in person) for PenTest+?
Tags: security
Published: 2020-02-03 21:43:14

[![enter image description here][1]][1]
I am a full-stack developer, I don't know much about cert, but I am very much interested in getting my first *PenTest+* certification. 



What is the best bootcamp (in person) for PenTest+ ?

I found this site : https://www.infosecinstitute.com/
They offered training and exam pass guarantee for $5000. 

I'm opening to any suggestion that might be a bit more affordable for me. 


  [1]: https://i.stack.imgur.com/f3J84.jpg
FPS problems, help needed.
Published: 2020-02-03 21:40:03

i5 4460 3.2ghz, rx580nitro+ 4gb
Ive been experiencing some unusual stuttering when playing Apex. Fraps is showing over 100fps on average but it feels like 50. I also tried Overwatch, where theres about 95fps avg but no stutter.
Everythings updated, cpu is at 50%-70% usage midgame, gpu at 100% (less than 5% when its resting). I did try limiting my fps to 60 (I play on a 60hz LG tv) but the problem remained the same, stutter on Apex but no stutter on Overwatch. I thought the problem might be the TV but playing Overwatch proved me wrong. Nontheless a small stutter but still very annoying considering I should be seeing 100fps, and lets say in tunnels (on Apex) it goes up to 170fps and the stutter increases which would mean that the TV is fighting my gpu and vice versa but it still doesnt explain how theres no issues on Overwatch and how Apex is still stuterring when I limit it to 60fps
New image API with amazing AI features is here!
Tags: api, ai, image, help
Published: 2020-02-03 21:24:59

Hello guys,
we are building a new product and we need your feedback!

Unblur offers an incredibly feature-rich AI based image optimisation, transformation and tagging for developers.

Our visual-search and image tagging API is super easy to integrate for any platform and serve a variety of use cases.

Unblur saves your developers an incredible amount of time implementing proper storage service.

Some of our cool features:
✔️ Secure image storing
✔️ Image transformation in a url
✔️ Image tagging and categorization
✔️ Image compression and optimization
✔️ Blazing fast image serving over CDN
✔️ Super easy API
✔️ Upload widget
✔️ Image management dashboard
✔️ Visual search API
✔️ Visual search widget

If you are building a new product or you want to try our solution in your existing product please contact me in my personal email: avgenakisg at gmail.com

For our first users we offer it for free!

Thanks,
George
How To Copy Properties from an Object To Another?
Tags: javascript, object
Published: 2020-02-03 21:14:21

Rest operator is awesome. Here is how to copy properties from one object to another using Spread operator.

```javascript
//copy properties from an object to another one
//using SPREAD OPERATOR.
const obj1 = {
    a: 2,
    b: 5
}
const obj2 = {
    ...obj1,
    c: 6
} //{a: 2, b: 5, c: 6}
```
Reading Snippets [43 => Productivity ]
Tags: productivity, beginners, todayilearned, todayisearched
Published: 2020-02-03 20:55:21

In the book, Art & Fear by David Bayles and Ted Orland, we are pointed to the benefits of getting your hands dirty faster, thus allowing for improvement of skills. This can prove to be more effective than spending time studying and theorizing about the "perfect" way to do things. 

Other approaches that could be considered include:

🔵 Write the minimal solution that gets the job done
🔵 Write automated tests (prevent regressions)
🔵 Write and (use) reusable libraries
🔵 Use well-known technologies where they work well
🔵 Use design patterns where they fit into place 


<kbd><small>Source:<a href="https://softwareengineering.stackexchange.com/questions/65705/how-to-code-faster-without-sacrificing-quality">How to Code Faster
</a></small></kbd>
WKWebView: Communicate from web to app with JavaScript
Tags: ios, swift
Published: 2020-02-03 20:33:06

As I have [shown](https://dev.to/nemecek_f/dynamically-modify-page-in-wkwebview-in-ios-3pb), you can easily communicate with website loaded in `WKWebView` using special method to run JavaScript on the page. You can also do this the other way around and send messages from website to your app.

The first step is to add this protocol: `WKScriptMessageHandler`. Then add message handler to the `WKWebView`:

```swift
webView.configuration.userContentController.add(self, name: "jsHandler")
```

The name can be anything you want and you can have multiple of them. The last step on the iOS app part is to implement method to receive messages sent to the handler we just added:

```swift
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
if let messageBody = message.body as? String {
		}
}
```

It is up to you to act on the received message 🙂

## Sending messages from website
To receive message, we have to first send it. It is one line of JavaScript code:

```javascript
window.webkit.messageHandlers.jsHandler.postMessage("Hello from website!");
```

The `jsHandler` corresponds to the name we used previously in our Swift code.
And that is all it takes to communicate with your app from `WKWebView`.

### Use cases

Why would you want to send messages from the page? For example you could extend websites menu with specific buttons/links and then open native dialogs or view controllers.

You can also catch specific events with JavaScript event listeners and can react on them.

_Is anything not clear? Do you want more information? Ask in the comments and I will do my best to help you. Thanks for reading!_



[![Scan it - wide banner](https://nemecek.be/media/images/scanItWideBanner.png)](https://apps.apple.com/app/scan-it-scan-and-export-pdf/id1509634112)
Code Smell: Null Check
Tags: codesmells, productivity, webdev, computerscience
Published: 2020-02-03 20:22:04

I love this code smell. First I find the solution to be fascinating. Second, the indicator (checking for null) is often NOT a problem, more so than in most code smells. But that's the beauty of code smells. They give us an indication that something MIGHT be amiss, but we have to check it out ourselves and decide if something really does need to be corrected.

So let's start by looking at an example of the problem:

![image](https://cdn-images-1.medium.com/max/800/0*Q8lIsatLPcXnLE5Y?)

Here we have some sample code from an eCommerce site. It's fairly typical on these sites to allow you to check out as a guest and not create an account.

Here is one such algorithm, where we determine the discount to apply to the order. If the user is checking out as a guest (the customer object is null) then we use a default discount, otherwise we use the customer's earned discount.

Looking at this method our null check seems fairly harmless. This is a reasonable way to implement the necessary functionality.

Now let's look at another method from that same class:

![image](https://cdn-images-1.medium.com/max/800/0*2y2nXwJdVTy800qZ?)

Here we have the same thing going, we have to know if the user is checking out as guest or not. And now we can start to see part of the problem. Our null checks are littered around our code. We can assume that this logic is common, so we have to frequently check to see if the customer is null for the order.

This is our code smell. Frequent checks for the same null.

So what do we do about this? There's a very cool fix we can apply here by using what's called a Null Object. Null objects are special classes which replace a null value in our code so that we can simplify our code. Let's see how this is done.

First we create a NullCustomer class. This is our Null Object. Notice the two methods it has. Remember where those methods are used?

![image](https://cdn-images-1.medium.com/max/800/0*pN5LzOU9OXBsXynE?)

Next we create our NullCustomer, and use it instead of setting the customer to null. This way, we do our null check only once.

![image](https://cdn-images-1.medium.com/max/800/0*WyOfRamd5TaJdfT9?)

And now, we can go back to our order class and fix the getDIscount and processOrder methods. Because our Null Object implements those methods, we no longer have to do any kind of check in our code. That makes our core business logic simpler.

![image](https://cdn-images-1.medium.com/max/800/0*p1uLzXY9zEr59azP?)

In fact, our getDiscount has become so simple, we may consider dropping it altogether.

This is the power of the Null Object used to solve the Null Check code smell. I really think this is a cool technique to solve a relatively common problem.

Happy Coding!

Signup for my newsletter at [here.](https://is-tracking-link-api-prod.appspot.com/api/v1/click/4616255200034816/5570275139911680)
Visit Us: [thinkster.io](https://thinkster.io/) | Facebook: @gothinkster | Twitter: @GoThinkster
What would you teach a frontend beginner in 2020?
Tags: discuss, beginners
Published: 2020-02-03 20:21:49

---
title: What would you teach a frontend beginner in 2020?
published: true
description: 
tags: discuss, beginner
---

In April, I will start teaching frontend development to design students at university.

The course curriculum wasn't updated for years, so I'm basically free to choose what to teach.

The idea is teaching them enough so they can implement a basic interactive prototype of their design idea with Web technology. They only have 4x13 hours to do this course and it isn't their main "project" in the semester.

I already have an idea what I will do, but I wanted to reach out to the community to see what your perspectives are.

What would you teach a frontend development beginner in 2020 if you would have to break it down to the bare essentials?