teleren/devto huggingface dataset:
How To Grow As A Backend Developer?
Tags: php, laravel, webdev
Published: 2019-10-10 17:49:41

At the time I am writing this, I do not know what yet to title this post. But this is what's on my mind.

Been learning to code for a while now. It's been a difficult long road without having anyone to really guide me. Fell in to tutorial purgatory for a long while and just kept copying other people's code. 

After a while I settled for Backend programming, PHP to be precise and I loved it. But getting someone to mentor me without having to pay has been difficult and the ones who try to pitch in are always too busy as they have to attend to other things. 

Learnt the basics of procedural PHP and just started getting into frameworks, Laravel. But somehow I feel stuck on trying to apply what I have learnt. 

Has anyone got an advice for me please cause I don't know how to move forward. Plus I need a mentor.
prepend_before_action in Rails
Tags: rails, tips
Published: 2019-10-11 11:17:27

---
title: prepend_before_action in Rails
published: true
date: 2019-10-10 17:37:56 UTC
tags: rails,tips
canonical_url: https://prathamesh.tech/2019/10/10/prepend_before_action-in-rails/
---

Rails encourages usage of callbacks in controllers to execute common pieces of  code before or after an action. A very simple example of this is calling the `authenticate_user!` method from Devise before every action to make sure that user is authenticated.

<!--kg-card-begin: code-->
```
class ApplicationController < ActionController::Base
  before_action :authenticate_user!
end
```
<!--kg-card-end: code-->

But what if you want to execute a different piece of code before calling `authenticate_user!`? I wanted to set a cookie based on whether the request was coming from mobile app or from web before calling `authenticate_user!`. The most important thing was I wanted to set the cookie only for a particular controller action.

<!--kg-card-begin: code-->
```
class MagicAuthController < ApplicationController
  # Set cookie before authenticate_user! before auth
  
  def auth
  end
end
```
<!--kg-card-end: code-->

This can be solved by multiple approaches. We can create a separate base controller for `MagicAuthController` and make sure the cookie is set before calling `authenticate_user!`

<!--kg-card-begin: code-->
```
class MagicBaseController < ActionController::Base
  before_action :set_cookie, only: [:auth]
  before_action :autheticate_user!
end
```
<!--kg-card-end: code-->

Though Rails also provides a nifty callback called `prepend_before_action`. It inserts the callback that is passed to it to the start of the callback chain.

<!--kg-card-begin: code-->
```
class MagicAuthController < ApplicationController
  def auth
  end
end

```
<!--kg-card-end: code-->

As the `MagicAuthController` inherits from the `ApplicationController` the callback chain consists of `authenticate_user!` as of now.

<!--kg-card-begin: code-->
```
class MagicAuthController < ApplicationController
  prepend_before_action :set_cookie, only: [:auth]
  
  def auth
  end
end
```
<!--kg-card-end: code-->

This changes the callback chain and now `set_cookie` is the first callback in the callback chain for the `auth` action.

Rails also provides other friends of `prepend_before_action` such as `prepend_after_action` and `prepend_around_action`.

It also accepts a block argument.

<!--kg-card-begin: code-->
```
prepend_before_action only: [:auth] { cookies[:clid] = params[:clid] }
```
<!--kg-card-end: code--><!--kg-card-begin: hr-->
* * *
<!--kg-card-end: hr-->

Want to know more about such tricks and tips from Rails? [Subscribe to my newsletter](https://prathamesh.tech/mailing-list) and keep up with Ruby and Rails.
Do you know about Jabit! ?
Tags: react, typescript, node, dotnet
Published: 2019-10-10 17:25:04

Hi everyone!

This is my first post and I'm so exited about that! Well, I want to share with you this page that I found recently but was a very extremly good help for me and I know will be for you too. Its name is Jabit! http://jabit.org/ This is a code generator tool created by Dennis Madrid | Ronald Madrid.

You can choose differents templates (Backend and Frontend):
- NetCore WebApi
- NodeJs
- Angular (Beta)
- React (Beta)
- Vue (Beta)

Next Releases: Net Core Blazor, Razor and Python

This tool already have a template to start to play with, but you can easily replace the Models with json structure (for reference: http://jabit.org/documentation) and create your own application!! 

Go to the documentation and check it out how to create it (you just need to run a line command in CommandPront).

I hope this can be helpful for everyone!

Cheers! :)
Xamarin 101: Part 6 - Xamarin.Forms Navigation with XAML
Tags: xamarin, tutorial, beginners, mobile
Published: 2019-10-10 17:18:24

---
title: Xamarin 101: Part 6 - Xamarin.Forms Navigation with XAML
published: true
description: You learned how to build a UI, make it functional, now it's time to navigate around!
tags: xamarin, tutorial, beginners, mobile
series: xamarin101
---

# Xamarin 101: Part 6 - Xamarin.Forms Navigation with XAML

You've learned how to build a user interface with XAML. Add some smarts to it with the MVVM pattern. Now it's time to add some more pages to the app and navigate around in it with this short video!

{% youtube UPD_2SVGQ6M %}

## Learn More!

* [Multi-page applications](https://docs.microsoft.com/xamarin/get-started/quickstarts/multi-page?WT.mc_id=xamarin101-c9-masoucou)
* [Xamarin.Forms navigation](https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/navigation/hierarchical?WT.mc_id=xamarin101-c9-masoucou)

Happy mobile coding! And as always, if you have any questions - please ping me on Twitter at [@codemillmatt](https://twitter.com/codemillmatt).
Git - Get your configuration right
Tags: github, git, codenewbie
Published: 2021-07-01 19:47:18

---
title: Git - Get your configuration right
published: true
date: 2019-10-10 17:12:00 UTC
tags: GitHub,Git,GitLab,codenewbies
canonical_url: https://blog.g33kzone.com/git-get-your-configuration-right
---

Many of our fellow developers might use the same old laptop for work as well as personal projects. In such cases, one might want the flexibility of quickly switching git configuration as per the type of project working upon.

For such scenarios, it would be advisable to leverage Git's global & local (i.e. limited to the project) configuration changes.

- Set Global Configuration
```
git config user.email abc@org.com
git config user.name 'User Name'

```

- Fetch Global Configuration
```
git config --global --get user.email
git config --global --get user.name

```

- Set Local Configuration
```
git config user.email abc@org.com
git config user.name 'User Name'

```

- Fetch Local Configuration
```
git config --get user.email
git config --get user.name

```
The Ultimate Guide to Next.js Authentication with Auth0
Tags: nextjs, javascript, authentication
Published: 2019-10-10 16:56:09

---
title: The Ultimate Guide to Next.js Authentication with Auth0
published: true
description: Learn how (and where) to authenticate your user in the different deployment models that exist for Next.js
tags: #nextjs #javascript #authentication
canonical_url: https://auth0.com/blog/ultimate-guide-nextjs-authentication-auth0/
---

It was almost 3 years ago that ZEIT released Next.js, a minimalist framework to build single-page Javascript applications in a simple yet customizable way. With a focus on performance and out of the box support for Server-Side Rendering (SSR), they reached over 280,000 weekly downloads on NPM and 40,000 stars on GitHub. The Next.js showcase confirms the success of the framework which is now being used by companies big and small, including Netflix, Scale.ai, Marvel, Jet, and even Auth0...

[Read on ⚡️](https://auth0.com/blog/ultimate-guide-nextjs-authentication-auth0/?utm_source=dev&utm_medium=sc&utm_campaign=nextjs_authn_guide)

![The Ultimate Guide to Next.js Authentication with Auth0](https://cdn.auth0.com/blog/illustrations/nextjs.png)
How do you setup local development database?
Tags: discuss
Published: 2019-10-10 16:53:10

---
title: How do you setup local development database?
published: true
description: what techniches do you use to setup a full working local 
tags: #discuss
---

Hi dev's, it's my first post on dev.to, we are facing some problems with local development in my office, and a bad local development environment is a root of so many problems, like too often broken test environment, the first problem is the database, we have spring boot with flyway migrations that setup some tables in the local database, but the tables are empty or in some occasions don't exist, I'm studying hard some things to get local development 100% I'm open to discuss with you about it. Thanks!
ThreeJS + Typescript + HTML Game Engine
Tags: threejs, typescript, html, gamedev
Published: 2019-10-10 16:22:31

Hi to all!

I've created a simple [SpaceInvaders with only JavaScript and CSS](https://dev.to/nicolalc/spaceinvaders-with-only-javascript-and-css-407c) game using only CSS, javascript and HTML.

The result was really interesting, and I wanted to move forward to something more complex, like __animated sprites__ and __collision detection__, using _typescript_ instead of _javascript_, emulating the __Unity 3D__ engine lifecycle methods and behaviours.

# Step 1 - converting js to ts
This was the easiest step, I've installed webpack and created a __webpack.config__ file to compile _ts_ files into _js_ and to copy static files under the __build/__ folder.

# Step 2 - using __background-image__ property instead of emoji content for sprites
I've tried to replace the emoji with a  __background-image__ property for enemies and player.

### The result?
Really bad! My FPS drops down to 1/5 maximum FPS instead of 55/60 FPS!

So I've moved to html canvas!

# Step 3 - HTML canvas
This step was one of the harders, I've recreated the entire sprite and game management using Transforms and generic classes, to handle my sprites position and scaling by an easy way.

So I've created a __GameObject__ generic class, and it's __factory__ to handle sprite creations and rendering.

### The result?
Not bad at all, but still glitchy because I was using the _2d_ canvas rendering context, which is less performant than the WebGL content.

# Step 4 - Moving to ThreeJS and start creating a real Engine
The final solution was to use WebGL, and to use it easily I've included ThreeJS into my project. Just a few reworks and the game works really good!

### The result?
Amazing! The game is running at 60 FPS!
Here there is the [result video](https://www.loom.com/share/3272dd25f56b47a99017c2969679e9e2)!

# Conclusions
I've created a simple HTML Game Engine! Using the _Unity C#_ lifecycle methods and other Game Development behaviours, and I want to improve it in my free time.

If anyone wants to collaborate the repo is free to use [here](https://github.com/NicolaLC/spaceinvaders-js).

I'll publish a playable demo when I've done the game ^^
Tex y Asciimath en Dev.to
Published: 2019-10-10 15:36:56

---
title: Tex y Asciimath en Dev.to
published: true
description: usando Tex y/o AsciiMath en Dev.to
tags: 
---

A primera vista no veo posibilidad de escribir fórmulas en Text (o Asciimath) cuando escribes un Post en Dev.to 

En Dev.to puedes escribir tus post usando Markdown más alguna otra funcionalidad que han añadido (y que habrá que investigar) pero Markdown no tiene nada para Tex por lo que voy a probar un proyecto que desarrollé hace un par de años para generar imágenes de funciones de forma online

Como este proyecto es un poco antiguo y actualmente está alojado en un servidor con pocos recursos dejaré para cuando esté actualizado y funcionando mejor un post donde lo explique.

Así pues lo siguiente serán simples ejemplos de lo que se puede hacer con esta versión sin muchas explicaciones.

La idea básica es que el servicio interpretará los parámetros de una URL donde se encontrará la expresión junto con otros parámetros de configuración y devolverá un PNG listo para ser insertado como imagen en el POST

A continuación algunos ejemplos:

Una expresión simple como `x=(-b+-sqrt(b^2–4ac))/(2a)`

se vería así

![](https://mathml2png.herokuapp.com/img/mathml.png?e=x%3D(-b%2B-sqrt(b%5E2%E2%80%934ac))%2F(2a)&f=AsciiMath&s=2&u=&t=false)


Una expresión compleja como esta

```
\begin{align} 
F(x)=\int{f(x) dx} \to F(1)=0.5*(F(0)+F(\infty)) \\ 
\text{ por ejemplo }\\ 
f(x)={-1 \over (x+1)^2} \\ 
\end{align}
```

se ve representada así

![](https://mathml2png.herokuapp.com/img/mathml.png?f=TeX&t=false&u=https://gist.githubusercontent.com/jagedn/606c89b7902ab1ced17dcd041152583c/raw/dff16750cb67c65c3b0c447f8d775af4d72b3300/mathml2png.png)
A11y Hook for Hiding Outlines
Tags: javascript, react, a11y
Published: 2019-10-10 15:27:06

Ever wish you could hide those pesky outlines that appear around all your inputs when they're focused, but also want to make sure your app caters to all users, the following hook listens to mouse click vs tab events to determine if a user is interacting with your site using keyboard or mouse and returns a boolean that you can use to control the outline on your components! Enjoy!
```jsx
import { useEffect, useState } from "react";

export const useA11yOutline = () => {
  const [outline, setOutline] = useState(false);
  const handleKeydown = (e) => {
    const isTabEvent = e.keyCode === 9;

    if (isTabEvent) {
      setOutline(true);
    }
  }
  const handleClick = (e) => {
    setOutline(false);
  }
  useEffect(() => {
    window.addEventListener('keydown', handleKeydown);
    window.addEventListener('click', handleClick);
    return () => {
      window.removeEventListener('keydown', handleKeydown);
      window.removeEventListener('click', handleClick);
    }
  });
  return outline;
};
```
Write your way to health
Tags: mentalhealth, writing, worldmentalhealthday, showdev
Published: 2019-10-10 15:20:15

---
title: Write your way to health
published: true
description: Why I'm building a writing platform
tags: mentalhealth, writing, worldmentalhealthday, showdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/pv1qe5mg2xz2br9q8swq.png
---

Growing up my environment taught me that strong men don’t cry. I was taught that counselling is for the weak. Talking about our problems leads to judgement and isolation. 

It turns out not talking about my problems lead me to isolation. I cried a lot when I was in high school. I hated myself and was looking for an escape. After a few failed attempts, I started to look for help. I turned to books, podcasts, and meditation. I’ve been adding tools to my toolbox for the past ten years and now I’ve decided to build my own.

Whether you are struggling with mental illness or not, building a healthy relationship with yourself is extremely important. Self-reflection and journalling have been shown to have many benefits ranging from mindfulness to sparking creativity. I’m building a product that helps you build a daily writing habit, one small step at a time.

With Wrabit, you can proudly express your unedited self. Writing helped me when I wasn’t ready to talk and it might help you too. Although Wrabit isn’t free, portions of the membership fees get donated to mental health research. The more you write, the more we donate.

Write your way to health with Wrabit 👇🏻

https://writewithwrabit.com
Kubernetes Cluster Networking 101
Tags: kubernetes, networking, devops, docker
Published: 2019-10-10 15:17:17

Kubernetes is a technology that helps you get the most out of your hardware. Containers are deployed on several nodes, making sure that every CPU cycle, every byte of memory, and every block of storage is not wasted. However, this is no easy task. Several challenges must be addressed when designing how the cluster will handle networking among containers:

- How the same pod containers can communicate with each other. This is handled 
  through the loopback interface. For more information, please refer to our 
  earlier article Kubernetes pods 101.
- How a container can contact a service. This is managed through Kubernetes 
  Services.
- How the cluster can receive external traffic. This topic is also covered by 
  Kubernetes Services.
- How a pod can contact another pod on the same node or on a different one, which 
  is the main focus of this article.
HOW I DEMONSTRATED A GROWTH MINDSET RECENTLY
Published: 2019-10-10 15:15:08

A Mindset is a belief that orients the way we handle situations — the way we sort out what is going on and what we should do. Your mindset has a profound effect on achievement, skills acquisition, and other areas of life. A person with a growth mindset believes their abilities can be gotten through hard work and dedication.

I used to love programming but i didn't know what is all about until I started to learn it, learning programming been a way for me to demonstrate a growth mindset but you can ask yourself how?
but before telling you about how I demonstrated it let me talk about how you can develop it:
-Acknowledge your weakness: Hiding from your weaknesses means you’ll never overcome them.

-View challenges as opportunities: Having a growth mindset means relishing opportunities for self-improvement.

-Try different learning tactics: There’s no one-size-fits-all model for learning. What works for one person may not work for you.

-Replace the word “failing” with the word “learning.”: When you make a mistake or fall short of a goal, you haven’t failed; you’ve learned.

Recently I demonstrated a growth mindset by attending women workshop to level up my technical skills, I call this a growth mindset because I was invited to attend the workshop right after failing to make it in the Bootcamp when you fail for the first time you might think that its normal that you can try again, but for the second time your point of view might start to change thinking that maybe this is not the things that you can try something else.

So I had to change my mindset by thinking that "challenges are what makes people grow" so when I failed I took it as an experience and when I was invited I didn't hesitate to accept. It was not easy because I had to start learning from scratch even what I thought I know already I had to repeat it what is interesting is that I learned many things like every end of the day I was pretty sure that I am not wasting my time.

And I can't forget to talk about challenges of working with different people who have different personalities, backgrounds, points of views, this is sometimes another challenge I faced during the workshop and it requires a growth mindset to move on with different types of people who can sometimes challenge you and feel like giving up.

In a conclusion, let me say that you can't achieve your goals if you give up easily, and if you are not ready to overcome all the challenges which will come in your way, so keep growing your mindset don't limit yourself.
Fresh Here..
Tags: webdev, javascript, react, ios
Published: 2019-10-10 15:06:39

Hey, everyone am a full stack developer with php and mysql tech..
now am shifting towords the MERN stack. 
Yesterday I started new journey with full of energy..so boosted right now..

Feeling very energetic..

new on DEV first blog..

from Monday I will upload my daily posts here with my improvements..

Thank You.
Quick Tip: Disable Button On Click
Tags: codepen, html
Published: 2019-10-10 15:03:01

In a world full of JS frameworks and templating languages, there's still occasionally a need to write very simple pages. With a habit of leaning into Vue, React, etc. it can be easy to forget the basics when we don't need anything flashy.

Here's a tiny snippet to disable a button when it's clicked without the need for any extra JS scripts. It only takes a few words in an `onclick` attribute. Could be useful if you have some basic HTML form that submits on a button press.

{% codepen https://codepen.io/jwkicklighter/pen/KKKdagv %}
[Vim問題]同じ行の指定文字が次に来る位置まで移動する方法は？
Published: 2019-10-10 15:02:23

この記事では、Vimでプラグインを使わずに「大文字または小文字に変換」する方法について、ご紹介します。 [解答] Vimのビジュアルモードで u/U キー キーバインド1. 大文字を小文字に変換する （ビジュアルモードで

つづきは[こちら](https://vim.blue/eyecatch-vim-move-to-character/)。
[https://vim.blue/eyecatch-vim-move-to-character/](https://vim.blue/eyecatch-vim-move-to-character/)
About Brett Nathan Buechler
Tags: brettnathanbuechler, brettbuechler, aboutme, indiana
Published: 2019-10-10 15:01:26

Brett Nathan Buechler took his strengths in science and microbiology to make a difference in changing patients’ lives by improving the education and known knowledge about diabetes. Brett Buechler is furthering his mission to improve patients’ lives with his decision to join a company looking to help eradicate diabetes.  Brett Nathan Buechler has donated both his time and financial support to several local charities over the years.  Brett Nathan Buechler has donated to the American Cancer Society Relay for Life both as an ambassador being a Cancer survivor and by having a team supporting the charity from 2004 till now.  Brett Buechler has also supported the JDRF and American Diabetes Association charity walks every August and September from 2008 till now.  Brett Nathan Buechler is active in the community via his church, iTown, and by donating his time and goods to local charities like Habitat for Humanity and Goodwill.  Brett Nathan Buechler enjoys traveling worldwide and taking vacations with his kids usually to Walt Disney World or Disneyland.  Brett Buechler is an avid sports fan and enjoys watching Iowa Hawkeye sporting events live with his family or friends.  Brett Nathan Buechler has 2 older sisters, 3 nephews, and 1 niece that he tries to see as much as possible.  In Brett Buechler’s spare time he enjoys going to concerts, musicals, gardening, and working around the house completing DIY projects.
[Vim問題]行頭・行末へ移動するキーは何種類ある？
Published: 2019-10-10 15:00:03

この記事では、Vimでプラグインを使わずに「行頭・行末へ移動する」キーについて、ご紹介します。 [解答] 5種類のキーで移動できる キーバインド1. 行頭へ移動する （ノーマルモード もしくは ビジュアルモード で） ^

つづきは[こちら](https://vim.blue/vim-row-home-end-motion/)。
[https://vim.blue/vim-row-home-end-motion/](https://vim.blue/vim-row-home-end-motion/)
[Vim問題]上下左右に1文字を移動するキーは何種類ある？
Published: 2019-10-10 14:57:42

この記事では、Vimでプラグインを使わずに「上下左右に1文字を移動する」キーについて、ご紹介します。 [解答] Vim では 2.5 種類のキーで移動できる キーバインド1. ホームポジションで上下左右する （ノーマルモ

つづきは[こちら](https://vim.blue/vim-move-1-character/)。
[https://vim.blue/vim-move-1-character/](https://vim.blue/vim-move-1-character/)