teleren/devto huggingface dataset:
Using FAKER
Tags: ruby, rails, faker
Published: 2021-09-07 20:54:09

Using faker will save you so much time and effort when creating fake data for your projects and its so easy to use.

First head to 
{% github faker-ruby/faker %}

I love using FAKER for my projects and development websites to flood my database with dynamic information. The nine person team over at Faker say "We're committed to offering the best faker generators." and they surely mean it.

Installation is super easy  :
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1s0y6yizfo9cnoux27li.png)

Usage :
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gxb8yr76ad2x6lns4th6.png)

This repo is still getting new updates so check in often to see what new things this generator can do. I'm waiting for the Michael Scott quotes generator to be released.

Check out the generators
(Found in README.md)  :
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5q5ei6t3xa3fnaoo0y6f.png)

Some examples :
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gw6gt5p76trma860vh7d.png)

Find one you like
(For example Faker::Ancient)  :
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vfb3rxd7pdey2r1vkvan.png)



They even offer customization  :
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fray3514kt5xwdxdvtcb.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r37s441zfmt6igt3u0nb.png)



Please go ahead and check out FAKER and while your there look into there other repos like  :
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fm1uzkk8f2hmju9frs4x.png)

As far free to use fake data generators go FAKER is easy to use, easy to comprehend and has so many fun generators to really dive deep into.
OSD600 - Introduction
Tags: opensource
Published: 2021-09-07 20:44:59

####1. Self-introduction####

Hi there, welcome to my blog. I am Vivian - a Vietnamese girl who is currently living in Toronto, Canada. I exposed to computer programming language when I was selected to participate in a Pascal competition in high school.  In the past, I never thought that I would become a programmer but right now I am majoring in Computer Programming and Analysis at Seneca College and studying to be a good programmer. 

I have a particular liking for web development and recently I started to have interest in learning about mobile app.

####2. About OSD course####

Open Source Development (OSD600) is a professional course I have chosen in the 5th semester after receiving a good piece of advice from my senior.  Additionally, Open Source is totally alien to me so that I want to learn deeply about it.  

Another reason that makes me interested in Open Source is its freedom. Programmers can feel free to develop an open source application with new useful features then use or share that application with other programmers. As a result, that application will be more and more developed, become a better version of itself and provide useful functions for users.  

After finishing this course, I hope that I will be familiar with git and be more confident to work on huge projects.

####3. The GitHub trending repo####

The GitHub repo, I have interest in is "**30 seconds of code**" [https://github.com/30-seconds/30-seconds-of-code]. It is a website which provides short JavaScript code snippets for users. I find it very helpful for me when I work on my project later on.

All in all, thank for spending time reading this post.
Happy coding!
Journey To The Centre of OSD
Tags: opensource
Published: 2021-09-07 19:55:45

### WHO AM I?

This handsome piece of hunk
![A picture of the handsome hunk (Me)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/05tugmjpyqyxx96cwlkf.jpg)

...Ok seriously though. I'm Antonio Bennett a student in the Computer Programming and Analysis (CPA) course at Seneca College. 

I was previously on co op for 8 months with the Ministry of Ontario specifically the Ministry of Children, Community and Social Services from January - August 2021. 

Now during these 8 months I did something most Linux Gurus would be proud of....I switch from VsCode to Vim/Neovim ;) This lead me to falling in love with the open source community and learning new things such as Rust and Svelte most recently. Due to this I am taking the OSD600 course to further learn about the open source community and how I can properly contribute to it.

### WHERE AM I?

At home duh we have school online ... *cough* Brampton, Ontario, Canada *cough*

### GOALS AND INTERESTS?

My goal in this course is to start the habit of contributing to open source projects and gaining experience. My interests at the moment is pretty broad since I have fell in love with both Rust and Svelte which covers Systems Programming to Web Dev. It would be great to work on projects that draw on either of these languages/tools.

### Github Trending Repo

The repo I chose is [Tauri](https://github.com/tauri-apps/tauri)

Of course with my new found disdain for VsCode and subsequently Electron (*seriously VsCode is considered the only good Electron app*) and new found love for Rust and Svelte, I had to choose a repo that included all these interests. 

Tauri, like Electron,  allows you to make native apps for Windows, Mac, Linux with IOS and Android support coming soon using front-end frameworks such as Svelte, React and Vue. This is really interesting because it allows web developers to bridge out into making native desktop applications with ease just like React-Native provides currently with mobile applications. 

I am looking forward to the progress Tauri makes and hopefully will play around with it at some point in the future. This just proves the meme is correct! Everyone should ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qwq3kukrf0k0ck00rsck.png)
Creating Peacekeeper
Tags: design, webdev, css, javascript
Published: 2021-09-07 20:31:25

**Peace to you!**

In this series, my first ever on DEV, I'll be breaking down some of the details behind one of my favourite website templates, Peacekeeper! This series is largely aimed at beginners, but anyone can benefit. Plus, your feedback is welcomed, because there's always room to learn and grow!

First, I'd like to start by explaining what Peacekeeper is, beyond what's immediately obvious of course.

## Peacekeeper is a single-page website template

![Peacekeeper Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ouqh01ajl0boq5vd8zgn.png)

This means that though there are multiple source files for each "tab" in the page, there is only *one* functional "page" from an end-user perspective. Though an end user can view several "sub-pages" (for want of a better term), they never actually need to navigate away from the landing page. This approach has a number of advantages, but also some disadvantages, which you'd have to weigh if you're taking this approach.

I've tried to identify a few below.

### Pros:

- No reloading.
- Faster load times (for most things at least).
- Most necessary resources are already loaded when new content is displayed.
- Potentially easier to manage (from a dev perspective).
- Everything feels self-contained.
- **(Optionally)** everything can be placed in one HTML file.

### Cons:

- Tabs cannot be accessed via links (this can be worked around).
- Noticeable delay when loading large or complex tabs.
- Requires JavaScript to be enabled, even if using a single file.

There are probably others, but I think these should give a relatively concise idea of what to expect when choosing this approach. Single-page websites are perfect for companies preparing a launch, or individuals seeking to hold an online identity via their own website. It is possible to allow users to navigate to specific tabs via hyperlinks to your website, using JavaScript to catch the specific ID of your tab and activate it.

In Peacekeeper, I did not choose this specific approach, but that's on purpose — because seeing as it is a template, I decided to keep to the basics.

## What I'll be covering in this series

![A screenshot of the portfolio section](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mnb48ps9ypfvp6ljz3dn.png)

To create Peacekeeper, I've employed a number of CSS capabilities to achieve some rather exciting results. You can change the page's background and theme on the fly, and changes are applied live (with a transition). Each tab comes with its own styles, and thanks to the use of semantic HTML, there's no need to add classes to everything in order to achieve such diverse results. In fact, JavaScript is only used where *(for the most part)* CSS can't *(or shouldn't)* be: triggering events.

All of this will be examined and explored in more detail going forward, and I'm pretty sure the DEV community will it useful!

## Stay tuned!

![A screenshot of the Peacekeeper documentation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u3pyu9vrlb45nqv0aoic.png)
Using Recursive Common Table Expressions to fill missing continuous data | Oracle SQL
Tags: sql, plsql, oracle, datascience
Published: 2021-09-07 20:01:00

---
title: Using Recursive Common Table Expressions to fill missing continuous data | Oracle SQL
published: true
description: Using Recursive Common Table Expressions and filling missing data using Oracle SQL
tags: sql,plsql, oracle, datascience
//cover_image: https://direct_url_to_image.jpg
---

##Context
I have a table which contains the value of a currency in others currencies by date, but only working dates.
I need the data for every date since the begining of a source table, being that the missing data for a day should be the previous available one.

*Sample data*:
![Source data](https://res.cloudinary.com/rolangom/image/upload/v1631107059/bcrd_tc_otras_mon0_w9qlla.png)
As you can see, the dates are not continuous.

##First try:
```sql
WITH srct(fecha) AS (
	SELECT MIN(fecha) fecha FROM BCRD_TC_OTRAS_MON
	 UNION ALL
	SELECT fecha + 1 fecha FROM srct WHERE fecha + 1 <= (SELECT MAX(fecha) fecha FROM BCRD_TC_OTRAS_MON)
)
SELECT a.fecha,
	NVL(dolar_can, LAG(dolar_can, 1) OVER(ORDER BY a.fecha)) dolar_can,
	NVL(franco_sui, LAG(franco_sui, 1) OVER(ORDER BY a.fecha)) franco_sui,
	NVL(euro, LAG(euro, 1) OVER(ORDER BY a.fecha)) euro,
	NVL(dolar_usd, LAG(dolar_usd, 1) OVER(ORDER BY a.fecha)) dolar_usd
FROM
	srct a
		LEFT JOIN
	BCRD_TC_OTRAS_MON b ON b.fecha = a.fecha
ORDER BY 1
```
*Results*:
![Data results try 1](https://res.cloudinary.com/rolangom/image/upload/v1631107060/bcrd_tc_otras_mon1_f1iiqe.png)
This approach takes the data from previous date, but it does not work for more than 1 day of continuous missing data.
It could work if you use `COALESCE` and multiple `LAG` functions, but at the end, the query would not look elegant.

##Second try:
```sql
WITH srct(fecha, dolar_can, franco_sui, euro, dolar_usd) AS (
	SELECT fecha, dolar_can, franco_sui, euro, dolar_usd FROM BCRD_TC_OTRAS_MON WHERE fecha = (SELECT MIN(fecha) fecha FROM BCRD_TC_OTRAS_MON)
	 UNION ALL
	SELECT a.fecha + 1 fecha,
		NVL(b.dolar_can, a.dolar_can), NVL(b.franco_sui, a.franco_sui),
		NVL(b.euro, a.euro), NVL(b.dolar_usd, a.dolar_usd)
	FROM srct a
			LEFT JOIN
		BCRD_TC_OTRAS_MON b ON a.fecha + 1 = b.fecha
	WHERE a.fecha + 1 <= (SELECT MAX(fecha) fecha FROM BCRD_TC_OTRAS_MON)
)
SELECT fecha, dolar_can, franco_sui, euro, dolar_usd
  FROM srct
ORDER BY 1
```
*Results*:
![Final results](https://res.cloudinary.com/rolangom/image/upload/v1631107059/bcrd_tc_otras_mon2_rqmcbm.png)
Using this approach you will get every date from srct and the previous available row data from the `BCRD_TC_OTRAS_MON` table for every missing date.

I hope it could help.

Thanks for reading.
Simple Ubuntu Docker Playground
Tags: docker, ubuntu, tutorial, mcdau
Published: 2021-09-07 19:50:41

---
title: Simple Ubuntu Docker Playground
published: true
description: What if I wanted to play around with Ubuntu inside Docker?
tags: Docker,Ubuntu,Tutorial,mcdau
cover_image: https://i.ibb.co/zNmbNLF/pink-forest.jpg
---

# What is this?

This is a tutorial on doing Ubuntu stuffs in Docker. It is intended to be a starting off point for doing common things in pretty much any image that can run `bash` or `sh`. Other tutorials will lean on this on this foundation.

# Why make this?

To keep it in a spot I remember and to share simple things with others.

# Steps

- Run the Ubuntu image with the `-i` and `-t` flags. [See documentation for more detail](https://docs.docker.com/engine/reference/commandline/run/)

```bash
# Run the image directly rather than exec into a container
docker run --name ubuntu-playground -it ubuntu bash
```

- Optional, verify your new container is running in a separate terminal window. This is a bit redundant since your terminal shell just switched, but it's good to be thorough!


```bash
docker ps
# ubuntu-playground will be in the NAMES column
```

- Install and run some stuff

```bash
# From prompt inside container
apt-get update
apt-get install -y curl jq
curl https://jsonplaceholder.typicode.com/users/1 | jq
```

- Profit 🤑

 ![Screen Shot 2021-09-07 at 2.35.58 PM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/he2i87dhrmogxf1y3ijr.png)
Server side or client side rendering? Vue | React + Rails API
Tags: rails, help, react, vue
Published: 2021-09-07 19:28:57

Hey 👋 

I am thinking of a side project that will leverage a Rails API backend (because I love it, it makes me happy, no science or general logic involved in that decision).

The front end is likely to be Vue or React depending on which one integrates with crypto wallet sign in the easiest  (specifically metamask or nami).

Question: What’s the benefit to doing Vue / React with Rails server side versus client side?

thanks
My very first blog ever!
Tags: beginners, opensource
Published: 2021-09-07 19:11:31

Hello everyone who is reading my first blog. My name is Tuan Thanh Tan aka Buck, I'm current living in Toronto, Canada. I'm glad you're spending your precious time reading this, Thank you.

I'm a Seneca student who has a huge passion on web development especially back end development. There are a handful of people who don't like doing back end stuff as it's quite boring and cumbersome. **BUT** I'm quite the opposite, I always wanted to try difficult things that people don't want to try. That's the reason why I chose OSD 600 for my fifth semester, this course isn't specifically about a aspect of programming but a variety. So I get to try a bunch of new technologies and improve my current skills.

As the course goes on, I want to take part in bigger projects such as TailwindCSS. I am a huge fan of TailwindCSS because I got a hang of it very quickly, and it fits perfectly okay with my ReactJS projects.

So, I did a little research on Github about trending projects in Javascript of this month. I found [grapejs](https://github.com/artf/grapesjs) is a free and open source web builder framework without you actually coding it. This can be a game changer in the future as people with no programming skills before can create a functional website on their own. It just needs a few minutes to get used to the user interface and then you're good to go. But to be honest, this framework will be a big plus if you just need a simple and nothing special websites for your restaurant or your little online shop. 

_Here's how to reach out to me_ 
[Linkedin](https://www.linkedin.com/in/tuan-thanh-tan-aa980419a/)
[Github](https://github.com/tuanthanh2067)
**Or**
_Email me at tuanthanh2067@gmail.com_
Encoding vs encryption for 📱iOS app devs
Tags: swift, ios, security, cryptography
Published: 2021-09-07 19:10:34

> **Anyone** can install your app from AppStore, decrypt and decode it — and read the data you stored there in a plist. Watch [@Anastasiia Voitova] (https://twitter.com/vixentael) ([@Cossack Labs] (https://twitter.com/cossacklabs)) and [@Vincent Pradeilles] (https://twitter.com/V_Pradeilles) disclosing how to secure your users’ data. 

**The truth is** any data you add to your mobile app when developing can be readable because it's a part of an application bundle. **Every single part of your application bundle is public information.** And all the info you put there massively affects all the app’s users. So, every secret you put there can reveal your app users’ secrets. 

What are the solutions?
> ⚫ If you want to store a particular session/token for the user that your application received during a transition to a backend, you should **put it into a keychain at runtime.** 

> ⚫ If you want to hide some information/tokens that you received in advance while building an application, the good way is to use obfuscation or encryption — probably the easiest is to **split the token and not put it as one string.**

Watch this video to get in detail:

{% youtube Vdsf3o851i0 %}

Often, **plaintext data looks encrypted while it’s just encoded**. For example, in JWT tokens. Any JWT token is a json encoded in base64 format.

So, all fields that you add there — email, name, account role, account balance – is stored in plaintext, just **encoded but not encrypted.** Use sites like jwt.io to find out the token content.

![Encoded but not encrypted](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/669c1pvke0u70pyz5qyk.png)

💡 Here’s a solution:
> To avoid revealing sensitive information, **don’t put it** in JWT — for example, use user ID instead of user email. Also, **make sure that all things that look like encrypted, are really encrypted.**

---
Say hi 👋 to [Anastasiia] (https://twitter.com/vixentael) and [Vincent] (https://twitter.com/V_Pradeilles)!
Follow us for more data security tips and news:
🔥[https://www.cossacklabs.com/] (https://www.cossacklabs.com/)
🔥[https://twitter.com/cossacklabs] (https://twitter.com/cossacklabs) 
🔥[https://github.com/cossacklabs] (https://github.com/cossacklabs) 
🔥[https://www.linkedin.com/company/cossack-labs/] (https://www.linkedin.com/company/cossack-labs/)
Hello World
Tags: opensource
Published: 2021-09-07 19:02:11

I'm Jia Hua and in the next 4 months my blog will be related to open source programs. I always had an interested in solving problems. 
 I wanted to take the open source class because back when I first try to contribute to open source program, I was overwhelm with the hundreds of files and lines of codes. I did not know where to start or how to contribute. Hopefully after taking this course, I will be more confidents on contributing to open source projects.
First blog post 
Tags: opensource
Published: 2021-09-07 18:47:56

Hi everyone, my name is Tue, I currently reside in Toronto and I'm trying to break into the open-source scene with DPS909 course. 

Since the beginning of college, I've heard people talking about open-source projects, collaboration and how it is the future of software development, though I'm curious how people from places can work together building a piece of software, I've not looked into it. 

My goals in this course are to understand git, Github, read repos and know how to contribute, most importantly, to get out of my comfort zone, to work with different technologies and community instead of doing things on my own. My interest jumps around a lot but I hope it stays in machine learning, front-end/back-end development, crypto. 

I chose

1. [frontend-clean-architecture](https://github.com/bespoyasov/frontend-clean-architecture) because I'd like to challenge my code design, maintainability and to learn more about design patterns. 
2. [react-use](https://github.com/streamich/react-use) because it provides custom hooks and it's used by lots of developers which also has a large number of issues need tackled. 

Cheers.
JavaScript - Strategy pattern 🧠
Tags: javascript, tutorial, webdev
Published: 2021-09-07 18:46:54

Do you want to avoid writing multiple if/else if or switch statement with a bunch of cases inside?

The strategy pattern can help us with that.

Imagine we have a use case where the user can sign up using different methods:

- Google Auth
- Facebook Auth
- Form submission

We want to avoid this:

```javascript
const AUTH_METHODS = {
  GOOGLE: 'GOOGLE',
  FACEBOOK: 'FACEBOOK',
  FORM_SUBMISSION: 'FORM_SUBMISSION'
}

const googleAuth = _ => {
  // ... Google auth code here
}

const facebookAuth = _ => {
  // ... Facebook Auth code here
}

const formSubmissionAuth = _ => {
  // ... Form submission code here
}

const handleAuthentication = method => {
  if (method === AUTH_METHODS.GOOGLE) {
    googleAuth()
  } else if (method === AUTH_METHODS.FACEBOOK) {
    facebookAuth()
  } else {
    formSubmissionAuth()
  }
}
```

How can we improve this using the strategy pattern?

```javascript
const AUTH_METHODS = {
  GOOGLE: 'GOOGLE',
  FACEBOOK: 'FACEBOOK',
  FORM_SUBMISSION: 'FORM_SUBMISSION'
}

const googleAuth = _ => {
  // ... Google auth code here
}

const facebookAuth = _ => {
  // ... Facebook Auth code here
}

const formSubmissionAuth = _ => {
  // ... Form submission code here
}

const authenticationStrategy = method => ({
  [AUTH_METHODS.GOOGLE]: googleAuth,
  [AUTH_METHODS.FACEBOOK]: facebookAuth,
  [AUTH_METHODS.FORM_SUBMISSION]: formSubmissionAuth
})[method]

const strategy = authenticationStrategy(AUTH_METHODS.GOOGLE)
strategy()
```

And if we want to pass parameters to some of the strategy functions, we can do it like this:

```javascript
const authenticationStrategy = method => ({
  [AUTH_METHODS.GOOGLE]: googleAuth,
  [AUTH_METHODS.FACEBOOK]: facebookAuth,
  [AUTH_METHODS.FORM_SUBMISSION]: () => formSubmissionAuth({ username: 'javascript', password: 'strategyPattern' })
})[method]
```

The strategy pattern, returns an object with key/value pair and what determines which key is the one to be "executed" is the `[method]` at the end, this is the dependency of our function, whatever value we pass there it will be mapped to the corresponding object key.