teleren/devto huggingface dataset:
Why I prefer Ionic over any other framework and why should you try it out too!!
Tags: react, ionic, javascript, typescript
Published: 2021-08-03 05:55:02

I've recently started using Ionic Framework as my main development framework.

Here's why I intend to work on Ionic and why you should try it out too


## • Here's what Ionic is according to the official documentation

Ionic Framework is an open source UI toolkit for building performant, high-quality mobile and desktop apps using web technologies HTML, CSS, and JavaScript with integrations for Angular, React, and Vue


## •Now here's my 2 cents on why I love Ionic:


### 1) Single Codebase, Working everywhere

Ionic is a hybrid framework that allows you to create websites, android, iOS, desktop apps and PWAs all with a single codebase.


### 2) Native and material design

Ionic comprises of a lot of Native components for both Android and iOS which allows the developers to give a native feel into their hybrid apps.

And it comes with built in material design support.


### 3)Framework Compatibility

Ionic works seamlessly no matter what framework you're using be it Angular, Vue or React.

It allows you to write your favorite apps using your favorite framework so that you can focus on the development rather than learning a new framework


### 4) Cordova plugins

Cordova plugins do the wonder for Ionic, giving access to different features of the operating system such as battery, pro-location, camera, access to logs and more. These plugins enhance the overall performance of apps.



What are your opinions about Ionic?

Will you be trying it out?

Lemme know in the comments down below
What is the size impact of importing Day.js
Tags: javascript
Published: 2021-08-03 05:53:43

In this article, I'll take a look at how much the build size increases when you add [Day.js](https://day.js.org/) library for date object manipulation. 

# Library

Day.js is an interesting library that implements a similar API as [moment.js](https://momentjs.com/) but with a smaller overhead. Because it's implementing the same [fluent interface](https://en.wikipedia.org/wiki/Fluent_interface), tree-shaking is not possible with it, but the library looks promising size-wise anyway.

# Code

The code I use in the benchmark is:
```js
import dayjs from "dayjs";

console.log("Yesterday was", dayjs().subtract(1, "day").toDate());
```

It's the same logic I have in the [luxon](https://how-to.dev/what-is-the-size-impact-of-importing-luxon-a-date-manipulation-library) & [date-fns](https://how-to.dev/what-is-the-size-impact-of-importing-one-method-from-date-fns) example.

# Build scripts

The build scripts I use are:
```sh
$ webpack --mode=production
```

```sh
$ esbuild src/index.js --outfile=dist/main.js --bundle --minify
```

# Benchmark

And the results are as follow:

## Webpack
```sh
npm run webpack  

> day-js-bundle-size@1.0.0 webpack
> webpack --mode=production

asset main.js 6.64 KiB [emitted] [minimized] (name: main)
runtime modules 663 bytes 3 modules
cacheable modules 6.43 KiB
  ./src/index.js 95 bytes [built] [code generated]
  ./node_modules/dayjs/dayjs.min.js 6.34 KiB [built] [code generated]

$ stat dist/main.js
  File: dist/main.js
  Size: 6802     ...
```

The build output is **6.64 KiB**. The webpack build is still pretty quick, contrary to the luxon benchmark, which was noticeably slower than esbuild.

## Esbuild
```sh
$ npm run esbuild   

> day-js-bundle-size@1.0.0 esbuild
> esbuild src/index.js --outfile=dist/main.js --bundle --minify


  dist/main.js  7.0kb

⚡ Done in 4ms

$ stat dist/main.js 
  File: dist/main.js
  Size: 7191    ...
```

The esbuild output is **7.0KiB**, which is about 5% bigger than the webpack one.

# Links

The benchmark [repository](https://github.com/marcin-wosinek/day-js-bundle-size).

# Summary

In this article, I have shown the size impact of day.js on the build size.
Weekend Wrap-Up
Published: 2021-08-03 05:45:07

In this post:

- [Working with Git](#working-with-git)
- [Thinking like a web developer](#thinking-like-a-web-developer)
- [I love this stuff](#i-love-this-stuff)

**This post was actually largely written on Sunday.** But I got caught up in re-factoring my blog routes and then writing about that process, and this one got lost in the mix.

###Working with Git
Git has been great. I've avoided merging and have taken some shortcuts - but I also wonder to what extent those 'shortcuts' are just solid practices when it comes to avoiding merging.

I've taken to just dropping whole swaths of code in the latest pull from remote and then pushing and pull-requesting on that code. No manual merges required. I imagine that that exact scenario - same clean, non-conflicting code - would merge just as easily in the traditional process of working entirely from the local repo, and I'll find out soon.

Ive been creating branches and merging locally, which gives me confidence to do it in a team-environment. It's actually been a really efficient process of checking `git hist` for code I might want to re-visit and just knowing how to revert. Flipping between branches and then merging in a small update I made on a small side branch. 

Like everything else, it's just practice. 

###Thinking like a web developer
A Web Developer is a type of software engineer. But it's important to know and to master your domain. There are many similarities between what we do and what a game dev do - but there are so many differences, too.

I'm a full-stack engineer, but this weekend, I wasn't always thinking like one. But I'm hard on myself. Really, what I should say is that I expect that as I gain more experience, the problems that I solved this weekend will take way less time to solve, or won't exist, with more experience. A big part of it is gaining familiarity with the tools. Another is just getting the reps. The same way that I can probably spot a bug-causing missing comma way faster now than I could when I started this journey. Part of it is the brain's background processes recognizing patterns (and broken patterns).

Take `bundle.js` for example. My server couldn't locate the resource at `./` (vs `/`) because the route's endpoint didn't branch directly off of the the root. So when the requested url was `/:user/Endpoint`, it was looking for `/:user/bundle.js`. Thankfully stackoverlow exists.

###I love this stuff

So I'm finishing up my Sunday work. What a weekend. Felt both productive and not-productive - my typical coding experience.

I love this stuff. Reading about something new. Getting to use it. Managing the time with pomodoro breaks. Doing a bit of other work ('work' work). Deciding which project, or feature, to work up next.

I've started thinking about authentication for the blog project. Is user auth MVP? Probably.

And wow, looking at authentication...node/express really give you a lot more work to do than I'm used to from Django (which gives you so much out of the box). But a lot of this stuff I know from Django - not the implementation, but the reasons behind a lot of the pieces.
Don't Learn These 5 Programming Languages
Tags: computerscience, cpp, programming, beginners
Published: 2021-08-03 05:41:13

Due to emerging technology many languages are in market and difficult for us to choose and learn so here is the the simple roadmap or we can say a video which guide you don't learn these programming languages in 2021

Have a look and share with others

https://youtu.be/LT59Lu9k-Vs

Share your views too
Add Access logs to S3
Tags: aws, cloud, beginners, tutorial
Published: 2021-08-03 05:34:35

Like websites we may need to add logs into our S3 bucket so that we can see what happens who added or deleted a certain file. This is very useful when we create a static website using S3 or we need logs for suspicious activity or find why we cannot access a file etc. When we add logging to our S3 bucket all our logs are stored in a different bucket in S3 and analyze them using various tools.

Now we will add access logs to S3 bucket.
* To add server access logs create a new bucket like we did in the previous articles.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sbrefa6wp3n9vpq22r7l.png)
* Then in your first bucket go to properties and scroll down to reach access logging.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o668l9byd9sokfm5fng1.png)

* Click on edit 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l3upopf0tw1aut2whb3t.png)

* Enable the setting then in the below portion click on browse S3 and select the new bucket we created for logging.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/blori372pqri2m6zzap6.png)

* In the bucket name you can add a prefix I'm adding a logs prefix `logs` to my bucket and save changes
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/upy3546r5dasgu8nf0wc.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xdbi3hil9953op60w1vg.png)
* This enables S3 logging in our bucket.

* Now you can check that this generates logs by accessing our files in S3. Remember it takes a few hours for S3 to generate logs so don't worry

Now you can query these logs using Athena service in AWS by  SQL very easily I'm attaching the link to the [documentation where you can see how to use Athena to analyze your S3 logs](https://aws.amazon.com/premiumsupport/knowledge-center/analyze-logs-athena/)

We have already learnt how to use S3. So now starting this article we are checking that how to make your S3 buckets more robust by logging. In the next article we will study how to Enable automatic backups using S3 replication so that anything cannot be deleted by mistake.
What I Learned Writing My First Book
Tags: writing, watercooler
Published: 2021-08-03 05:31:22

Recently, I tried my hand at writing a book. It's a super-short one based on To-Dos and personal planning, but I explored a lot of elements around how I can write and self-publish a book of their own.

[The book](books2read.com/how-to-stay-sane-with-your-tasks) is available for free on [Google Play](https://play.google.com/store/books/details?id=hOU3EAAAQBAJ) only (due to technical reasons), but I've also made a video about the entire process and also my learning from the exciting exercise.

{% youtube jZ__rihvcMQ %}

**Spoilers:** The book was written entirely using free and open-source software, so the video does include a lot of technical details about the process as well.

As usual, you may either watch [the video itself](https://youtu.be/jZ__rihvcMQ) or read the entire thing as an article over [my website](https://myterminal.me/diary/20210801/(VIDEO)-What-I-Learned-Writing-My-First-Book).

Regardless, do provide me your valuable feedback, be it positive or even negative.
Arvis: cross-platform launcher compatible with alfred-workflow
Tags: react, electronapp, productivity, typescript
Published: 2021-08-03 05:21:48

Have you ever felt like trying to use some useful Alfred's workflows in Windows or Ubuntu?

At least, I often had felt like that I wanna use make and use workflows in other OS.

When I made some Alfred workflows, I felt that some workflows might be used enough in other OS with a little code change.

So I started to making Arvis.

https://github.com/jopemachine/arvis

Arvis works in cross-platform.

It is built with Electron, react, iohook, robotjs.. and other awesome libs.

Arvis is a project I'm working on by myself and the quality is not that high compared to Alfred.

(still, lots of unexpected bugs should be fixed)

You must be disappointed if you expect Alfred's awesome features to current Arvis

But I'm keeping on fixing bugs, thinking of interesting ideas.

If you're interested, I'd appreciate leaving me any kind of feedback.

Overview homepage:
https://jopemachine.github.io/arvis.com/

Related links:
https://github.com/jopemachine/arvis/blob/master/documents/basic-usage.md

https://github.com/jopemachine/arvis/blob/master/documents/workflow-links.md

https://github.com/jopemachine/arvish

https://github.com/jopemachine/arvis/blob/master/documents/plugin-links.md
CompileSwift Podcast – Listener Question, UIKit, or SwiftUI?
Tags: compileswift, podcast, swift
Published: 2021-08-07 06:52:10

---
title: CompileSwift Podcast – Listener Question, UIKit, or SwiftUI?
published: true
date: 2021-08-03 05:16:34 UTC
tags: CompileSwift,Podcasts,swift
canonical_url: https://peterwitham.com/swift/cs-s03-e08/
---

 ![Podcast cover image](https://secureservercdn.net/45.40.148.117/7a7.1ac.myftpupload.com/wp-content/uploads/2021/08/CS-Square-Podcast-UIKit-or-SwiftUI-300x300.jpg)

{% spotify spotify:episode:6fwGTYQUN6O8kS6mid7JqX %}

## Season 3 Episode 8

I suspect this is a question developers for the Apple platforms have been getting a lot over the last year or so.

> Should I learn and use UIKit or SwiftUI?
> 
> <cite>CompileSwift Listener</cite>

Fair to say it is not easy to answer this question. In this episode, I try my best to offer an answer for both sides and present questions that might help you figure out which is the right route for you and your applications.
Installing a Minimal Debian system the Arch Way
Tags: linux, debian, arch
Published: 2021-08-03 05:14:59

If you've read my previous post about me migrating my ThinkPad from Arch to Debian, you must also be knowing that it wasn't a conventional install. I chose a tool called `debootstrap` (much like Arch's `pacstrap`).

{% post myterminal/why-and-how-i-migrated-my-thinkpad-from-arch-to-debian-27cm %}

I also created a mini tutorial/demo about how one can install Debian using debootstrap. As usual, you can either watch [the video](https://www.youtube.com/watch?v=G1GaDEiAeiU), or read the transcript of the video from [my website](https://myterminal.me/diary/20210724/(VIDEO)-Installing-a-Minimal-Debian-system-the-Arch-way).

{% youtube G1GaDEiAeiU %}
How to earn crypto by setting up a validator node on CENNZnet
Tags: cryptocurrency, blockchain, cennznet, decentralisation
Published: 2021-08-03 05:02:07

In a Poof of Stake blockchain network, you don't need super computers to set up a node to produce blocks.

By contributing computational power, you will earn cryptocurrencies as a reward.

**Hardware requirements:**
CPU - Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
Storage - 150GB, ideally 450GB
Memory - 64GB

Setting up a validator node is easy. 

Video walk through:
{% youtube ZYb7mu3Yeh0 %}


Check out the detailed guide here:
[How to set up a validator node on CENNZnet](https://cennz.net/knowledge-hub/staking-guides/how-to-set-up-a-validator-node-on-cennznet/)
How to install nuclei in any  linux ☠️
Tags: kalilinux, bugbounty, tools, ethicalhacking
Published: 2021-08-03 04:55:30

Nuclei is a fast and customisable web vulnerability scanner which will help you getting in low hanging web vulnerability 

First we need to install Go 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z3fjdhasbtwfgtcum70u.png)
 
I always install my tools in /opt folder in linux . Its not neccessary you can clone the repo anywhere .
git clone https://github.com/projectdiscovery/nuclei.git 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yjko28ckd559x3j5w6oo.png)
 
cd nuclei/v2/cmd/nuclei/
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/154p10meufef7m75xguq.png)
  
go build . 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jhmxza09f7nqrpm6hdeg.png)

now we have to move the file to bin folder so that we can access nuclei from anywhere 
mv nuclei /usr/local/bin/ 

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kk99zkf4xciv3r1kc4qf.png)

Now we are ready to roll![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ynimmzjxtzhvpp084j42.png)
 
Happy Hacking ☠️

Listen to my favorite Lofi music Tracks 
https://www.youtube.com/watch?v=_C12AC2Cxn8
Run uTorrent on Windows 10 or 11
Tags: hack, torrent, utorrent, tor
Published: 2021-08-03 04:20:14

Note: Usage of Torrents is banned in some parts of the world. Make sure you are doing this legally. Continue at your own risk

Who doesn't like free content. And when it comes to getting awesome content, like TV Shows, movies and other material for free, there's no match for TOR Server. And who doesn't know how we download those on our computers. Let me give you a hint: It's name start with t and ends with a t with 7 letters and represents a strong and fast-moving stream of water or other liquid. Yes. You are correct. Its TORRENT.

One of the most-widely used tool for download torrents on windows is uTorrent, and windows defender always blocks the software as soon as it detects it on your machine. Well, I was searching for a solution after upgrading to Windows 11 Insider Preview, and only today, found the solution. 

It's simple. Just follow the steps below:
## 1. Download uTorrent for free
You must first download and install a uTorrent executable file (uTorrent.exe) from their official website at https://www.utorrent.com/desktop/. Although the browser might warn you not to download the software, you can ignore the warning and continue with the downloading.

## 2. Disable Virus & Threat Protection
It's quite simple. You have to disable Virus and Threat Protection service on your machine for time-being until you install uTorrent. You can do so simply in Settings > Privacy & Security > Windows Security > Virus & Threat Protection for windows 11 and Settings > Windows Security > Virus & Threat Protection. Don't forget to turn them back on once you are done installing.

## 3. Allow uTorrent
The third and last step goes in waiting. You must wait until your system detects uTorrent and Blocks it. Then simply go back to the virus & threat protection center, and look for "Allowed Threats". Once in, you would see an empty window with link to "Protection History". Simply find the app with respect to the time installed or blocked, and scroll down on that card to find "Actions" Button. From that button, click "Allow on Device" and confirm that you want to do so.

Viola! You are done. Now you can access any torrent on your windows machine.
How to implement a scroll snap with intersection observer
Tags: help, css, scrollsnap
Published: 2021-08-03 04:11:36



I am inspired by [Rolls Royce website](https://www.rolls-roycemotorcars.com/) and want to implement the same scroll snapping feature in mine as well, I did it with the HTML default `scroll-snap-type` but which gives me expected behavior but creates two scrollbars, one for the container and another one for the body, which is not expected so I tried to go with the `IntersectionObserver` but it causes an issue, I can travel to only adjacent slide when directly jumping from 1st slide to 3rd slide.

Here is the code sandbox link: https://codesandbox.io/s/scrollsnap-forked-pre0c?file=/pages/index.vue

{% stackoverflow 68629851 %}

Here is the code that I am working:
```ts
<template>
  <main class="landing">
    <nav class="scroller">
      <ul class="scroller__list">
        <li
          class="scroller__item"
          v-for="(slide, index) in slides"
          :key="index"
          @click.prevent="scroll(slide.id)"
        >
          <a
            class="scroller__dot"
            :href="'#' + slide.id"
            @click.prevent="scroll(slide.id)"
          ></a>
        </li>
      </ul>
    </nav>
    <div class="slides-container">
      <slide
        class="slide"
        v-for="(slide, index) in slides"
        :key="index"
        :img="slide.img"
        :id="slide.id"
        :format="slide.format"
        :filter="slide.filter"
        >{{ slide.content }}</slide
      >
    </div>
  </main>
</template>

<script lang="ts">
import Vue from "vue";

export default Vue.extend({
  data() {
    return {
      slides: [
        {
          img: "car-slide-1.png",
          content: "hello world",
          id: "car-slide-1",
          filter: "color-burn",
        },
        {
          img: "car-slide-2.png",
          content: "Second Car",
          id: "car-slide-2",
          filter: "color-burn",
        },
        {
          img: "car-slide-3.png",
          content: "Third slide",
          id: "car-slide-3",
          filter: "color-burn",
        },
      ],
      observer: null as any as IntersectionObserver,
      options: {
        threshold: [0.5],
        root: process.browser
          ? document.getElementsByClassName("slides-container")[0]
          : null,
      } as IntersectionObserverInit,
    };
  },
  methods: {
    scroll(id: string, who: string | null = null) {
      console.log("scrolling to ", id, who ? "by " + who : "");
      document.getElementById(id)?.scrollIntoView({
        behavior: "smooth",
        block: "start",
      });
    },
  },
  mounted() {
    let scrolling = false;
    this.observer = new IntersectionObserver((entries, observer) => {
      entries.forEach((entry) => {
        if (entry.isIntersecting && !scrolling) {
          let top = entry.boundingClientRect.top;
          scrolling = true;
          window.scroll({ behavior: "smooth", top: window.pageYOffset + top });
        }
        scrolling = false;
      });
    }, this.options);
    document
      .querySelectorAll(".slide")
      .forEach((slide) => this.observer.observe(slide));
  },
});
</script>
```
Thai word tokenizers benchmark: nlpo3 vs newmm
Tags: benchmark, thai, nlp, tokenizer
Published: 2021-08-03 04:09:17

---
title: Thai word tokenizers benchmark: nlpo3 vs newmm
published: true
description: 
tags: benchmark,thai,nlp,tokenizer
//cover_image: https://direct_url_to_image.jpg
---

Thanathip Suntorntip Gorlph ported  Korakot Chaovavanich's Thai word tokenizer - [Newmm](https://github.com/PyThaiNLP/pythainlp/blob/dev/pythainlp/tokenize/newmm.py), written in Python, to Rust called [nlpo3](https://github.com/PyThaiNLP/nlpo3). The [nlpo3 website](https://github.com/PyThaiNLP/nlpo3) claimed that nlpo3 is 2X faster than Newmm. I felt that Nlpo3 must be faster than this claim because in contrast to Python's Regex engine, [Rust's regex](https://github.com/rust-lang/regex) runs in the linear time since it was constrained not to support looking back/ahead. Moreover, 2X faster is [ambiguous](https://www.quora.com/When-referring-to-the-speed-of-processors-is-2x-faster-the-same-as-100-faster-or-is-it-200). 

So I conducted a bit different experiment on Mac mini M1. Both Nlpo3 and Newmm run on from Zsh instead of Python Notebook. I tested on 1 million lines of Thai Wikipedia snapshot. The result is that Newmm took 3.66X of the time that Nlpo3 required for tokenizing the same text on the same computer.

## Setup

* Computer: Scaleway's Mac mini M1
* Rustc: rustc 1.54.0 (a178d0322 2021-07-26)
* Python: Python 3.8.2
* OS: Darwin 506124d8-4acf-4595-9d46-8ca4b44b8110 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:27 PDT 2021; root:xnu-7195.141.2~5/RELEASE_ARM64_T8101 arm64
* Script:

```Bash
#!/bin/bash

set -x

INPUT=thwik-head1m.txt

for i in {1..10}
do
  { time python3 newmm.py < $INPUT > newmm.out ; } 2>> bench_newmm.txt
  { time nlpo3 segment < $INPUT > cham.out ; } 2>> bench_o3.txt
done
```

* A command line interface for newmm:

```Python
from pythainlp import word_tokenize
import sys

for line in sys.stdin:
        print("|".join(word_tokenize(line[:-1])))
```

* nlpo3 version: 1.1.2
* nlpo3-cli version: 0.0.1
* chamkho version: 0.5.0
* dataset: https://file.veer66.rocks/langbench/thwik-head1m.txt

### Result

#### nlpo3

```
[root@exper1 ~]# % grep real bench_o3.txt 
real    2m10.923s
real    2m12.014s
real    2m10.931s
real    2m9.448s
real    2m9.055s
real    2m10.570s
real    2m10.672s
real    2m10.140s
real    2m11.220s
real    2m9.941s

```

#### newmm

```
% grep real bench_newmm.txt 
real    7m52.180s
real    7m58.090s
real    7m57.071s
real    8m9.779s
real    7m54.576s
real    7m52.807s
real    7m59.109s
real    7m58.489s
real    7m59.604s
real    7m57.844s
```
#### Average
* nlpo3

```
% grep real bench_o3.txt | ruby -lane 'BEGIN { all = 0.0; cnt = 0 }; cols = $F[1].split(/[ms]/).map {|x| x.to_f }; v = cols[0]*60 + cols[1]; all += v; cnt += 1; END { p all/cnt}' 
130.49140000000003
```

* newmm

```
% grep real bench_newmm.txt | ruby -lane 'BEGIN { all = 0.0; cnt = 0 }; cols = $F[1].split(/[ms]/).map {|x| x.to_f }; v = cols[0]*60 + cols[1]; all += v; cnt += 1; END { p all/cnt}'
477.9549
```

#### Performance ratio

3.66