teleren/devto huggingface dataset:
How to rename Asp .Net Core 2.2 Identity Tables to not have AspNet prefix in EF Core
Tags: netcore, beginners, aspnetcore, csharp
Published: 2018-12-16 17:55:38

---
title: How to rename Asp .Net Core 2.2 Identity Tables to not have AspNet prefix in EF Core
published: true
description: How to rename Asp .Net Core 2.2 Identity Tables to not have AspNet prefix in EF Core
tags: netcore, beginner, aspnetcore, csharp
---

Not sure if the code below should be considered a hack, but the easiest way of removing the `AspNet` prefix is to iterate through the models.

```csharp
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    base.OnModelCreating(modelBuilder);

    foreach (var entityType in modelBuilder.Model.GetEntityTypes())
    {
        var table = entityType.Relational().TableName;
        if (table.StartsWith("AspNet")) {
            entityType.Relational().TableName = table.Substring(6);
        }
    };
}
```

Found the initial code in a [2014 asp net issue](https://github.com/aspnet/Identity/issues/300) and since copy paste didn't cut it, did a quick update of the method / property names.

This also allows you to replace it with whatever else you want, or add a generic table prefix.
Instagram clone challenge
Tags: showdev, react, challenge
Published: 2018-12-16 17:47:43

---
title: Instagram clone challenge
published: true
description: 
tags: showdev,Reactjs,Challenge
---

I appered for an online hackathon challenge on React, The task given for me was to build an Instagram clone web app.

I really liked working in react, how it helped me build faster with organised code.In short time I finished the task given,because with help of plug and playable components ( yes ,I shamefully reused most of my prev project components 😁😁 ).

I still hate my first experience as web dev when I have to care about the order of script tags and multiple libraries,dependencies confilcts.

 

{% github yashwanth2804/photocon %}

https://photocon.surge.sh/
Have You Been "Ghosted" By An Employer?
Tags: discuss, career
Published: 2018-12-16 17:28:47

A recent [Washington Post article](https://www.washingtonpost.com/business/2018/12/12/workers-are-ghosting-their-employers-like-bad-dates/?noredirect=on&utm_term=.c10c4d0b2556) claims that millennials are increasingly ghosting their employers. Meaning, they just leave for a new job without telling anyone in advance and not showing up to work.

While I have never seen it actually happen, I can totally imagine it. And while walking out on your employer may not be the most professional way to leave, let's get real here; I've been "ghosted" by more companies than I can count.

I've had one company where they had me take a full day off work (unpaid), so I could come to their office for an interview, only to never hear back and get no replies to my emails.

I've had a friend who was ghosted after getting an offer!

I don't condone just walking out without saying goodbye, but if I worked somewhere where I didn't feel safe to bring up negative feedback, I would probably do the exact same thing.

I know most companies wouldn't hesitate to treat me the same way if it suited them.

Have you ever experienced being ghosted by an employer? Have you felt the need to ghost a place you were working at? 

At the oposite end, have you experienced a company that went out of their way to be transparent and open with you, even when they didn't have the best of news to share?
Sublime Text Vs VS Code
Tags: ide, gui, editor
Published: 2018-12-16 17:23:12

---
title: Sublime Text Vs VS Code
published: true
description: Difference in sublime text editor and  VS code editor, for developers
tags: ide, gui, editor
cover_image: https://res.cloudinary.com/programmmerrushikeshcloud/image/upload/v1544980267/dev.to/sub_vs_vscode.png
series: Editors for developer
---

We all developers are familier with many of the editors or IDE's. But at different projects or timeline we need to migrate among many editors, most common free editors are Sublime Text & VS Code.

Some times we confused in deciding an editor for upcoming project. So here are the keypoints to be noted.

**Sublime Text :**
1. Everyone loves the multiline selected editing
2. Plugin support
3. Define own syntax
4. Extensible by Many plugins

**VS Code:**
1. Most users rest on the integrated terminal
2. Almost plugin for every language
3. Watching on code and errors
4. Loved by typescript or Angular developers
Nuxt.js+Firestoreの場合に安全にSSRする方法
Tags: nuxt, firebase, firestore, japanese
Published: 2018-12-16 14:35:55

---
title: Nuxt.js+Firestoreの場合に安全にSSRする方法
published: true
description: 
tags: nuxt,firebase,firestore,japanese
canonical_url: https://crieit.net/posts/Nuxt-js-Firestore-SSR
---

Nuxt.jsをサーバーで動かしてFirestoreを使い、且つサーバーサイドレンダリングしたい時には色々考えることが出てきます。懸念点と対応した方がよさそうな点をまとめてみます。

## SSRしない場合との違い

SSRせずクライアント上でFirestoreからデータを取る場合ですが、匿名認証にしろ、SNSアカウントの認証にしろ、認証しているかどうかでセキュリティルールによりデータを守りやすく、他者によるFirebaseプロジェクトの設定を盗用しての勝手な操作を防いだりすることができます。

しかし、asyncData内によるSSRとなると、そのクライアント側の認証情報を利用することはできません。そうなるとデータを守れないどころか、そもそもセキュリティルールが設定されているとデータにアクセスすることすらできません。こういう時にどうすれば良いかを考えます。

## どのように解決するか

### Cloud Functionsの利用

今回はCloud Functionsを利用する方法を考えました。具体的にどうするかというと、asyncData内ではfunctionsからデータを取るだけにします。例えば下記のような感じです。

```javascript
  async asyncData({ params }) {
    const response = await axios.get(functionUrl)
    return response.data
  }
```

呼び出し方はどうであれ、通信が発生するので上記のようにリクエストは１回にした方が良いでしょう。functions側でそのページ専用のアクションを作ってデータを返します。

```javascript
export const showUser = functions.https.onRequest((req, res) => {
  return cors(req, res, async () => {
    const user = await User.getUserByUsername(req.query.id)
    res.json({
      user,
      posts: await Post.getPosts(user.uid, 5)
    })
  })
})
```

### データの取得方法

しかし、これでは先程のasyncDataと同様、セキュリティルールの関係でデータが取れないのでは？　と思われるかもしれません。ただ、Firebaseにはサーバー用のFirebase Admin SDKというものがあります。これはセキュリティルールに関係なくデータを扱うことができるため、これを利用します。具体的には下記のような形です。

```typescript
import * as admin from 'firebase-admin'

const firestore = admin.firestore()
const usersCollection = firestore.collection('users')

export async function getUser(uid: string) {
  const querySnapshot = await usersCollection
    .where('uid', '==', uid)
    .get()
    .catch(error => {
      console.error(error)
      return null
    })

  if (!querySnapshot || querySnapshot.size == 0) {
    return null
  }

  const user = querySnapshot.docs[0].data()
  user.id = querySnapshot.docs[0].id
  return user
}
```

クライアント側とは微妙にcollectionの取り方が違うだけで、基本的にはほぼ同じです。このようにしてサーバーサイドレンダリングのためのデータ取得処理を行うことができます。

## セキュリティルールを無視で良いのか？

今回の例のfunctions側でのデータ取得処理に関しては、ルールを無視で問題ありません。

というのも、そもそもSSRの目的としては、クローラに認識してもらうためのSEO対策になるかと思います。つまり、ユーザー認証が必要なデータを取る必要は一切無いということになります。あくまでも誰もが閲覧できるパブリックなデータを取るだけです。そのため基本的には認証に関するセキュリティルールをこの場で考慮する必要はありません。ただ、corsはちゃんと挟んでおきましょう。

## まとめ

やってみて思いましたが、これって普通のサーバーを使った開発と同じですよね！？　なんとなく手軽さが失われた感じはありますが、それでもまあサーバーを管理する必要が無いのは大きなメリットではあることに変わりはないでしょう。

他にも色々と方法はあるかもしれませんが、とにかくどの様な方法にしろ、どのようにデータを守るかはしっかり考えて構築が必要となります。

以前認証とセキュリティルールについて書いた考察もありますので、もし気が向いたらそちらもぜひ御覧ください。

[Firebaseの匿名認証はなんのためにあるのか - セキュリティ編](https://crieit.net/posts/Firebase)
picross.io - nonogram game by me :)
Tags: javascript, node, game, gamedev
Published: 2018-12-16 15:38:23

---
title: picross.io - nonogram game by me :)
published: true
description: Hey guys, just now I publish my own picross game writed on HTML, NodeJS and CSS, pleasy check it, maybe you like it! :) http://picross.io 
tags: javascript, nodejs, game, gamedev
---
An URL Shortener Which Can Be Even Hosted on GitHub Pages with Help Of jsonstore.io : FossURL
Tags: showdev, opensource, javascript, talk
Published: 2018-12-16 12:44:06

---
title: An URL Shortener Which Can Be Even Hosted on GitHub Pages with Help Of jsonstore.io : FossURL
published: true
description: let's talk about a simple url shortener which can be even hosted on GitHub/GitLab Pages or any static site hosting
cover_image: https://thepracticaldev.s3.amazonaws.com/i/4pbmr8u23kzve1km0ecf.jpg
tags: showdev , opensource , javascript ,talk
---
Do you guys remember my old article : 
{% link https://dev.to/bauripalash/building-a-simple-url-shortener-with-just-html-and-javascript-16o4 %}

In that article I discussed about building your own URL Shortener with **jsonstore.io as database** which can be even hosted on any Static Site Hosting Service even in GitHub/GitLab Pages.

Actually before writing that article I built an URL Shortener called **FossURL** and the article includes minimal code chunks to build bare-bones of your own URL Shortener. 
{% github bauripalash/fossurl %}

> Even the project was trending on Product Hunt. After these incidents I got few contributors and many improvements was done!😊 Thanks To The All Contributors❤

### What Was The Goal? 🎯

Actually The goal was to build a simple URL Shortener which can be hosted with GitHub Pages and doesn't need any costly server to host it, I knew it was not gonna be **Super Secure** because everything was done in client side.

### What Was The Inspiration? 🌠

Ah Actually There was No Inspiration 😂 , I was looking for a free URL Shortener with support for custom domain, at last I found some services but found that those had some limitations such as limited link creation per day, limited clicks and so on!
So , I decided I'll build my own URL Shortener! And now you can see the result!❤

I could have built that with Node , Python or PHP but I wanted something different but also simple.

### What FossURL isn't 😑

* Super Turbo Nitro Fascinating Amazing Dazzling Fast 😉
* Most Secure URL Shortener of the universe 😉

### What's New In That So-called 'v2.0' 😎
* Improved Speed
* New UI inspired by **dev.to**
* Removed All 3rd-party libraries

### Screenshot 🎉
![img](https://thepracticaldev.s3.amazonaws.com/i/953cm4h3vh2qzmq6k7zi.png)

So, I guess that's enough for today, feel free to contribute to FossURL , It'll be so kind of you ❤

---
If You Like My Work (My Articles, Stories, Softwares, Researches and many more) Consider [Buying Me A Coffee ☕](https://www.buymeacoffee.com/palash) 🤗
BxJS Weekly Episode 41 - javascript news podcast
Tags: javascript, node, podcast, news
Published: 2018-12-16 11:36:22

---
title: BxJS Weekly Episode 41 - javascript news podcast
published: true
description: Listen to the best javascript news of the week in a podcast form
tags: javascript, node, podcast, news
---

Hey dev.to community!

BxJS Weekly Episode 41 is now out! 🚀
Listen to the best javascript news of the week in a podcast form right here.
You can find all the mentioned links [here on github](https://github.com/BuildingXwithJS/bxjs-weekly/blob/master/links/18-50-Episode-41.md).

You can now also listen to [BxJS Weekly on iTunes](https://itunes.apple.com/de/podcast/bxjs-weekly/id1441956525)! 🎉

You can also watch or listen to this episode on:
- [YouTube](https://www.youtube.com/watch?v=S80ou0mgIBM)
- [Castbox](https://castbox.fm/episode/BxJS-Weekly-Ep.-41-Dec-15%2C-2018-(javascript-news-podcast)-id1378315-id110513368)

Any feedback is appreciated 😁

Additional stuff:
- [Twitch channel](https://www.twitch.tv/yamalight)
- [Discord server](https://discord.gg/hnKCXqQ)
- [BxJS Weekly github repo](https://github.com/BuildingXwithJS/bxjs-weekly)

Social media links:
- [Twitter](http://twitter.com/yamalight)
- [Medium](https://medium.com/@yamalight)
- [Github](http://github.com/yamalight)

If you enjoy my content, please consider [supporting me](https://codezen.net/support.html) 😉
Great News for the Developers! Join hands with the Mobile Industry Experts at Mobile Growth Summit San Francisco 2019
Tags: conference, developers, mobileindustry, mgs2019
Published: 2018-12-16 09:17:04

---
title: Great News for the Developers! Join hands with the Mobile Industry Experts at Mobile Growth Summit San Francisco 2019
published: true
description: Mobile Growth Summit San Francisco 2019 will take place on 13–14 February at Park Central. Get 30% flat offer in early bird publisher tickets.
tags: conference, developers, mobile industry, mgs2019
---

Mobile Growth Summit San Francisco 2019 will take place on 13–14 February at Park Central. Get 30% flat offer in early bird publisher tickets.  [HURRY NOW](https://mobilegrowthsummit.com/mgs19/?promo=WOMA30#!/register).

Mobile Growth Summit San Francisco 2019 is a two-day, non-vendor conference which will help you to connect with and learn from mobile growth and brand marketing professionals specializing in the areas of user acquisition, monetization, retention/engagement, re-engagement as well as data science & analytics as it pertains to mobile, retail and mCommerce brands.

**Why you should attend?**

**Learn:** Witness one-of-a-kind dialogues between growth marketing luminaries from Facebook, Google, Lyft, Uber and more.Thought-leaders from all areas of the industry will be sharing hard data you can use to refine your strategies and make 2018 your best year yet.
**Connect:** Expand your professional network of growth marketing experts at our exclusive parties, mixers and social events. Build meaningful long-term business partnerships in a fun, friendly, publisher-first environment.
**Grow:** Attend intimate workshops and break-out sessions that teach the skills needed to take your growth marketing career to the next level. Get firsthand exposure to the technical breakthroughs driving innovation and success in today’s growth marketing industry.

Their amazing lineup consists of dozens of mobile app marketing industry leaders, as well as content curated and crafted for the best mobile brand marketing panels and presentations for maximum value!

Mobile Growth Summit San Francisco 2019 is organized by Mobile Growth Fellowship which is the world’s first and largest dedicated network of Mobile industry leaders and professionals.

Mobile Growth events focus on exploring the latest trends in Mobile Marketing, Advertising and Distribution for Mobile Applications with a specialization on User Acquisition, Monetization and Retention & Engagement.

Join this growing mobile marketing community to gain valuable insights from the mobile UA (User Acquisition), Retention, and Monetization worlds to inspire your growth strategies.

For tickets and event details visit event website.
My app is built.. but Docker deployments have me confused. Help!
Tags: help
Published: 2018-12-16 07:48:09

---
title: My app is built.. but Docker deployments have me confused. Help!
published: true
description: First-time docker user who now is clueless as to how to deploy to production.
tags: help
cover_image: https://derickbailey.com/wp-content/uploads/2017/05/error.jpg
---

I'm looking for those with docker experience to help me wrap my head around moving from development and into production. I would normally throw this type of stuff onto stackoverflow but I find the feedback and insights from our dev.to community being really constructive and useful for others to learn too.

Current situation:

I'm a first-time docker user and I've been working on a side project which I've got running fine in containers and lifted with docker-compose in development as a full stack. Theres a producer app, rabbitmq worker queue, consumer app, caching database and a sql database with a website front end amounting to 6 images. I have  registered these within my private gitlab instance and I have a semi-decent setup for keeping my images up to date after changes.

Whenever I dip into the docker documentation it throws out things such as deploying with swarm, compose and machine. I've spent a couple of pain staking days getting docker-machine installed on a private vps to allow remote management since docker docs seem to suggest this is the way to go, however this is where the problems have been endless.

So far docker-machine is completely horrific to work with using the generic driver. I've hit problem after problem and spent a great deal of my time digging through various fixes in their github issues list. I'm not overly confident in whether it's going to run smoothly when my application is eventually deployed so I wanted to double check with the great dev.to community as to the route you typically follow.

At the moment I'm fine running on a single VPS which should hopefully simplify things. In the future, there are workers in my architecture which pull from a worker queue and if I need to scale it would most likely be spinning up more workers to get through the tasks.

As soon as I look outside of the docker documentation I start to read things like.. rancher, kubernetes, portainer etc. I'm not completely sure whether these are relevant or even needed in my case so it would be great to hear some feedback on those too.

Actually just found this .. what a mine field https://landscape.cncf.io/
AoC Day 16: Chronal Classification
Tags: adventofcode, discuss
Published: 2018-12-16 06:53:57

---
title: "AoC Day 16: Chronal Classification"
published: true
description: "Day 16: Deciphering the time machine's assembly language!"
cover_image: https://thepracticaldev.s3.amazonaws.com/i/tr7u1cqpb4yzpvf4j2wt.png
tags: adventofcode, discuss
series: Advent of Code 
---

*Note:  I accidentally blew away all of the content of this post, so forgive me if it's suddenly much different than it used to be.*

On [Day 16](https://adventofcode.com/2018/day/16), we've got some example inputs and outputs to machine instructions in our time machine and we need to figure out which opcodes do which things.

There were a few challenges similar to this in years past.  Let's see how everybody likes this one.
React-Loadable in React HOOKS
Tags: react, reactjshooks, reactloadable, codesplitting
Published: 2018-12-16 06:16:41

---
title: React-Loadable in React HOOKS
published: true
description: code splitting HOC in react hooks
tags: reactjs, reactjs-hooks, react-loadable, code-splitting
---

What if react-loadable was written in hooks(new featuer in react 16.7)'?



Here's a HOC written in hooks to load reactjs component asynchronously

```jsx
import React, { useEffect, useState } from "react";
import nprogress from "nprogress";
import "nprogress/nprogress.css";

export default (loader, loading) => props => {
  const [loadedComponent, setComponent] = useState(null);

  // this works like componentwillMount
  if (!nprogress.isStarted()) nprogress.start();

  if (loadedComponent) nprogress.done();

  useEffect(() => {
    let mounted = true;

    mounted &&
      loader().then(
        ({ default: C }) => mounted && setComponent(<C {...props} />)
      );

    // componentUnMount
    return () => (mounted = false);
  }, []);

  // return the loaded component
  const Component = loadedComponent || loading || <div>loading..</div>;
  return Component;
};
```
Effective Testing 
Tags: testing
Published: 2018-12-16 05:53:33

---
title: Effective Testing 
published: true
description: At some point you must stop testing. 
tags: testing 
---

This is an area I have a number of conflicting anecdotal situations (not what I'm covering here). This includes a sequence of related thoughts but contain no satisfactory conclusion. 

We already know that testing software will never confirm software doesn't have bugs, that there are endless possibilities, and at some point we must stop. 

There are also many different ways to facilitate testing. Examples are machine validation, manual exploration, and human falliblty. And we also want to cover aspects of the software, performance, usability, and many more.

There is also the great push to test closer to the code (shift left was it?). Leading to unit testing, CI/CD systems which piece code and sequences together. We even get to have devs and QA working closer together (or QA completely eliminated). 

I bring all this up because it is about balance. It also becomes more complicated when you realize people have different skills (breadth vs depth) and you need to identify, hire, and train to balance out all those areas. It is not good to expect everyone to be the same. Differences in people can be an asset to testing. If only I knew what that looked like.

I don't think I can meet every aspect to effectively test the application. I think this might be a problem area for companies, they have an expectation that one person or a team who are tasked to be the same, can meet all the needs to effectively cover the product.

I find that I rely more heavily on the different project roles to catch issues, from the dev to the PM. But if the project manager finds an issue this tends to be viewed as a failure of testing (note this is not the same as laying blame, but a location to add new steps before approval). I'm still trying to figure out how to turn this into official testing and even expected.
How to make react router replace component only after the matched route asynchronously loaded..?
Tags: react, reactrouter, nprogress, codesplitting
Published: 2018-12-16 05:32:50

---
title: How to make react router replace component only after the matched route asynchronously loaded..?

published: true
description: asynchronously load a component
tags: reactjs, react-router, nprogress, code-splitting
---

So here's the situation - When a `Link` is clicked the nprogress bar will start and I want react-router to only replace the current component with the matched route once that's done loading asynchronously..  just like in instagram.. 

[![enter image description here][1]][1]

**But I am only getting this -**


[![enter image description here][2]][2]

I didn't find a solution to this anywhere on the internet.. so I am asking this question here in dev. I am hoping someone here can solve this.


  [1]: https://i.stack.imgur.com/fajqB.gif
  [2]: https://i.stack.imgur.com/kykwY.gif
Utilizing Webassembly from D
Tags: webassembly, dlang
Published: 2018-12-16 04:59:29

---
title: Utilizing Webassembly from D
published: true
description: 
tags: webassembly, dlang 
---

So I really haven't gone down this path, but it corresponds to my other post for D, I don't really see too many accessible libraries for web assembly; yet here D is with something making good headway. 

Spasm looks like it has implemented the translation for basic types utilizing a GC restricted subset of the language.


https://forum.dlang.org/thread/fgzmgdhazqungwqjqves@forum.dlang.org

On another note anyone know what Go is doing to avoid its GC?
IPLD: data model of the content-addressable web
Tags: ipld, contentaddressable, decentralized, creative
Published: 2018-12-16 03:07:33

---
title: IPLD: data model of the content-addressable web
published: true
description: 
tags: ipld, content-addressable, decentralized, creative
cover_image: https://thepracticaldev.s3.amazonaws.com/i/wbzwmpsncy2vz30m5cnf.png

---

A new idea about linked hash data. 

URL address --> Content address(hash)

https://ipld.io/

![](https://thepracticaldev.s3.amazonaws.com/i/wbzwmpsncy2vz30m5cnf.png
)

There is a movement of decentralized web including a project by father of web. And others include IPFS, Beak browser, Mastodon to return rights of data to users..