teleren/devto huggingface dataset:
Why (most) startups should only write TypeScript
Tags: typescript, javascript, react, webdev
Published: 2022-11-13 10:53:20

As an early engineer at a startup, you get to make the choice of what language to use. This is a big decision...choose TypeScript.

Before I go on further, there are some edge cases where this is not the case.

1. You (or your team) have deep expertise in another language (i.e. Ruby, Go, etc.)

2. You (or your team) are building specific technology with a dominant language (i.e. Python for machine learning)

3. You (or your team) want to optimize for fun/happiness and another language provides that

Now that we got the edge cases out of the way, here is why (most) startups should only write TypeScript.

## One language for frontend/backend/mobile

There are huge benefits to using one language for everything. We can share code and every engineer can be full stack. 

JavaScript/TypeScript is the only language in the world that can be used to build a complex web frontend (i.e. React), backend (i.e. Express), and a mobile app (React Native).

In the early stages of the startup, it's all about finding product market fit as quick and efficiently as possible. We can choose to optimize each product if necessary (i.e. converting React Native to Swift) once the startup is mature.

## Easy to recruit/onboard engineers

Advocates of obscure languages will claim choosing such a language will attract better engineers to the team. This may be true in the beginning, but costs soon outweigh the benefits as the startup scales.

Recruiting and onboarding engineers is hard enough, we shouldn't make it harder by choosing an obscure language. Everyone already knows TypeScript or can pick it up within a week because of its familiar syntax and robust community. There's also endless packages/libraries to speed up development.

## Satisfies both static and dynamic type advocates

TypeScript provides just enough structure to satisfy static type advocates and just enough flexibility for dynamic type advocates. It's the happy medium that will prevent your team from looking for something else.

# Conclusion

If you are in a situation to choose a language for a startup, make the pragmatic choice and go with TypeScript. If you go with any other language, the team might end up resenting you in the future.
Cryptopals #42: personal impressions
Tags: cryptopals, rsa, padding
Published: 2022-11-13 08:55:46

Atm I just finished #47, and starting #48. But I need a little break, so I decided get back to this notes and publish them for a bit of relaxation. Spoiler: #47 **and** #48 are on Mr. Bleichenbacher too. So much of him, a genius man, I guess. But these challenges feel like they worth it, no complains.

This one is easy to find a good write-up, so let me describe how I _didn't solve_ it. Actually I'm not unique here, again. (Will add link to a write-up describing the same problem which blocked me.) Though, I completed the code for the solution, and it was a really well math preparation for next challenges.

So here's a couple of question this challenge left me with, and kind of an answer to one of them, describing what blocked me from solving it.

The first of my question was: does it really still present? I mean "We find new instances of it every other year or so.", but when does this statement is still relevant? Then I was caught by surprise *how much this padding scheme still in use as default*. 

So, it's really hard for me to say how wide these *intriguing parameters* (_exponent = 3_) are in use since the time challenges were introduced. But if we take a little bit more global look (especially from perspective of following challenges of the set), then we will conclude that entire PKCS1* scheme is a problem. And 'oh, boy', how default is this one. It turns out that given the frequency of its misuse (remember that _once a couple of years_ note?) it were receiving patchy workarounds one by one, making it even more tricky to implement correctly in turn. So the main conclusion seems to be: use other padding schemes! OAEP, PSS, switch to modern cryptography...

It could be not that bad in this particular challenge, but globally it's very illustrative. And the answer... As soon authors didn't mentioned hash to use with the challenge, I stuck with the most default currently: SHA-256. And the thing is it doesn't leave so much space for _garbage_ in the end of the payload, so you basically run out of variations to construct a cube for most of the messages. So maybe sha-256 kind of solves the local problem that was present to us. (Obviously at the time of introduction SHA-1 was the go to choice, and its solution isn't constrained so tightly.)

On the other hand my conclusion(s) should be taken with a bit of salt. I really tried during the challenge to nullify garbage at all (unsuccessfully), then to solve the problem mathematically, and ended up with computational solution. The one thing that was bugging me is that more mathematical checks were telling that there is a solution, but computational were just exhausting the space for it. Maybe it's the one I could revisit later, though I bet the solution indicated by math approach just need some more space for the garbage bytes.

This one last question would be interesting to discuss with other Cryptopals in anyone would drop a look here! Leave a comment, share your experience.
Day37 of #100DaysOfCode
Tags: webdev, tailwindcss, nextjs, 100daysofcode
Published: 2022-11-13 10:40:05

Redesigned 90% of the company list page.

Need to fix a few CSS issues and then I can move on to data fetching.

The issue with data fetching is that should I continue using Notion as the CMS for now or should I find another CMS to use???

I’m looking at Contentful and Prismic but haven’t really gone into details with neither of them. 🫠
In One Minute : REST (REpresentational State Transfer)
Tags: rest, api, beginners, oneminute
Published: 2022-11-13 10:30:00

REST (REpresentational State Transfer) is an architectural style that uses identification of resources; manipulation of resources through representations; self-descriptive messages, and hypermedia as the engine of application state, to build distributed systems that are scalable and resilient to change.

The term was introduced and defined in 2000 by Roy Fielding in his doctoral dissertation. Fielding is one of the principal authors of the [Hypertext Transfer Protocol](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) (HTTP) specification versions 1.0 and 1.1.

In simple language, REST is an alternative to SOAP based web services. Where SOAP tries to model the exchange between client and server as calls to objects, REST tries to be faithful to the web domain.

{% embed https://youtu.be/QKouziqOwh8 %}

## Resources

- [Representational state transfer](https://en.wikipedia.org/wiki/Representational_state_transfer), on Wikipedia,
- [Architectural Styles and the Design of Network-based Software Architectures](https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm), Fielding's dissertation introducing REST, and his clarification regarding the necessary usage of hyper-text in REST APIs
- [implementing-rest](https://code.google.com/archive/p/implementing-rest/) on Google Code.
- [implementing-rest](https://spring.io/blog/2013/12/02/springone2gx-2013-replay-rest-ful-api-design) with Spring.
- [How to GET a Cup of Coffee](https://www.infoq.com/articles/webber-rest-workflow/)

## Books

- [RESTful Web Clients Enabling Reuse Through Hypermedia](http://shop.oreilly.com/product/0636920037958.do)
- [RESTful Web APIs](http://shop.oreilly.com/product/0636920028468.do)
- [RESTful Web Services Cookbook Solutions for Improving Scalability and Simplicity](http://shop.oreilly.com/product/9780596801694.do)
- [RESTful Web Services for the real world](http://shop.oreilly.com/product/9780596529260.do)
gup - Update binaries installed by "go install" with goroutines.
Tags: go, showdev
Published: 2022-11-13 08:44:34


![gup demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rkznjr62kvjmt9bhzk9q.gif)

**[gup](https://github.com/nao1215/gup)** command update binaries installed by "go install" to the latest version. gup updates all binaries in parallel, so very fast. 

It also provides subcommands for manipulating binaries under $GOPATH/bin ($GOBIN). It is a cross-platform software that runs on Windows, Mac and Linux.

gup has over 90% test coverage and is registered with [go awesome](https://github.com/avelino/awesome-go). For golang users, gup is an easy-to-use command and I recommend it to everyone.

[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)  

## How to install
```
go install github.com/nao1215/gup@latest
```

## How to use
### Update all binaries
```
$ gup update
gup:INFO : update binary under $GOPATH/bin or $GOBIN
gup:INFO : [ 1/30] github.com/cheat/cheat/cmd/cheat (Already up-to-date: v0.0.0-20211009161301-12ffa4cb5c87)
gup:INFO : [ 2/30] fyne.io/fyne/v2/cmd/fyne_demo (Already up-to-date: v2.1.3)
gup:INFO : [ 3/30] github.com/nao1215/gal/cmd/gal (v1.0.0 to v1.2.0)
gup:INFO : [ 4/30] github.com/matsuyoshi30/germanium/cmd/germanium (Already up-to-date: v1.2.2)
gup:INFO : [ 5/30] github.com/onsi/ginkgo/ginkgo (Already up-to-date: v1.16.5)
gup:INFO : [ 6/30] github.com/git-chglog/git-chglog/cmd/git-chglog (Already up-to-date: v0.15.1)
   :
   :
```

### Update the specified binary
```
$ gup update subaru gup ubume
gup:INFO : update binary under $GOPATH/bin or $GOBIN
gup:INFO : [1/3] github.com/nao1215/gup (v0.7.0 to v0.7.1)
gup:INFO : [2/3] github.com/nao1215/subaru (Already up-to-date: v1.0.2)
gup:INFO : [3/3] github.com/nao1215/ubume/cmd/ubume (Already up-to-date: v1.4.1)
```

### List up command name with package path and version under $GOPATH/bin
list subcommand print command information under $GOPATH/bin or $GOBIN. The output information is the command name, package path, and command version.
![list sample](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3n5n6vxzl4ssbgcinjku.png)

### Remove the specified binary
```
$ gup remove subaru gal ubume
gup:CHECK: remove /home/nao/.go/bin/subaru? [Y/n] Y
gup:INFO : removed /home/nao/.go/bin/subaru
gup:CHECK: remove /home/nao/.go/bin/gal? [Y/n] n
gup:INFO : cancel removal /home/nao/.go/bin/gal
gup:CHECK: remove /home/nao/.go/bin/ubume? [Y/n] Y
gup:INFO : removed /home/nao/.go/bin/ubume

$ gup remove --force gal
gup:INFO : removed /home/nao/.go/bin/gal
```

## Conclusion
gup is a fast and easy to use tool. There are other features I have not introduced.

If you are interested, please visit GitHub. Thank you.
https://github.com/nao1215/gup
Tip: React conditional className, empty strings and null
Tags: react, programming
Published: 2022-11-13 10:00:00

When developing React components, you often need to conditionally apply a `className` attribute to one or more elements. Sometimes, you will have two or more possible values depending on a condition. But there are also times that you might apply a `className` based on a condition or leave it completely empty otherwise.

There is a correct way to handle a conditional empty className and an incorrect one. Surprisingly, the incorrect way is pretty common and examples of it can be found all around the web. Consider the following code:

```jsx
const MyComponent = ({ enabled }) => {
  return ( <div className={enabled ? 'enabled' : ''}> Hi </div> );
};

const OtherComponent = ({ enabled }) => {
  return ( <div className={enabled ? 'enabled' : null}> Hi </div> );
};

ReactDOM.render(
  <>
    <MyComponent enabled={false} />
    <OtherComponent enabled={false} />
  </>,
  document.getElementById('root')
);
```

In this code example, we define two very similar components. Both of them conditionally set the `className` of an element based on the value of the `enabled` prop. The first one will set the `className` to an empty string if `enabled` is `false` and the second one will set it to `null`.

The resulting output is pretty similar. However, if you carefully inspect the HTML, you will notice that the first one will render `<div class>Hi</div>` whereas the second one will render `<div>Hi</div>`. This kind of markup (an attribute being present but without value) is rather uncommon and you'd rarely ever see something like that without React. This subtle difference is quite important and might be the root of a lot of problems, especially when writing CSS selectors for elements with/without any classes (e.g. `[class]`/`:not([class])`).

Therefore, you should prefer `null` when you don't want to add a `className` to an element, instead of an empty string. It keeps the markup cleaner and might help prevent some potential issues.

---

_Do you like short, high-quality code snippets and articles? So do we! Visit [30 seconds of code](https://www.30secondsofcode.org/) for more articles like this one or follow us on [Twitter](https://twitter.com/30secondsofcode) for daily JavaScript, React and Python snippets!_ 👨‍💻
5 Most Used Linux Commands For Beginners
Published: 2022-11-13 09:49:47


![A Linux Command line](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cunllyya2wbuh9yujwwn.jpeg)

After a few months of learning to code in the command line, I have come to understand and get to love using Linux to write most of my programs.

As a beginner who is starting to use Linux, you might find it challenging to use the command line especially if you have gotten so use to working on GUI.

In this post, I will share with you 10 most used Linux Command and it's uses.

1.
pwd: Since you are working in the command line, it might sometimes be difficult for you to know which directory you are working on, that's why `pwd` meaning `print working directory` will print out the current directory you are working on.
Usage:
```
pwd
```


2.
cd: Also known as `change directory` will help you navigate your way into directory directory
for example: to change into another directory in the same directory you type
```
cd <directory_name>
```


3.
ls:  Known as `less` will will all the files and directory in the current working directory
```
ls
```


4.
sudo apt-get install: I use this command most of the time to install essential tools or programs into my Linux machine
```
sudo apt-get install <program_name>
```


5.
ps: This command is used to print the PID or Process Id of all currently running processes within your Linux machine.
```
ps
```

This are my most used Linux Command,which tend to come in whenever I work in the Linux CLI
Thanks for reading.
How To Add Google Adsense in Our React Website?
Tags: webdev, react, javascript, beginners
Published: 2022-11-13 09:41:09

**First We Add given Below AdSense code in our "index.html" File in between the <head> </head> tags like This.
You Get This Code From Your Google AdSense account.**




```
<head>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXXXXXXX"
     crossorigin="anonymous"></script>
 </head>
```


**Now, Second We Create AdSense Component,Which We use in the place where we want to show Ads. AdsComponent.js **



```
import React, { useEffect  } from 'react';

const AdsComponent = (props) => {
    const { dataAdSlot } = props;  



    useEffect(() => {
       
        try {
            (window.adsbygoogle = window.adsbygoogle || []).push({});
        }

        catch (e) {

        }

    },[]);



    return (
        <>
            <ins className="adsbygoogle"
                style={{ display: "block" }}
                data-ad-client="ca-pub-XXXXXXXXXXXXXXX"
                data-ad-slot={dataAdSlot}
                data-ad-format="auto"
                data-full-width-responsive="true">
            </ins>
        </>
    );
};

export default AdsComponent;
```

**And Now Finally time to show our ads in our React Pages Like this.**

```
import './App.css';
import AdsComponent from './AdsComponent';

function App() {

//Note provide dataAdSlot value of your data-ad-slot which is your ad unit no.
    return (
        <>
            <h1>Place To show Google AdSense</h1>
           <AdsComponent dataAdSlot='X7XXXXXX5X' />
        </>

    );
}

export default App;
```

Well done! Finally Create AdSense Component For our React Website !

Drop some love by liking or commenting ♥


**_Reference [w3schools](https://www.w3schools.com/react/default.asp)_**

**[Download Source Code from GitHub Repository](https://github.com/BIHARISOFT/EduBox/tree/master/google_adsense_react_component)**
Top Sites for Education and Career Enhancement
Tags: career, webdev, programming
Published: 2022-11-13 09:35:39

➢ ► FREELANCING
➢(http://www.fiverr.com/ 
➢http://www.upwork.com/
➢http://www.odesk.com/ 
➢http://www.elance.com/
➢http://www.99designs.com/
➢http://www.freelancer.com/
➢http://www.guru.com/
➢http://www.peopleperhour.com/ 
➢http://www.freelanced.com/ 
➢http://www.ifreelance.com/


)
➢ ► CAREER
➢https://www.linkedin.com/
➢https://www.indeed.com/
➢https://www.naukri.com/
➢https://www.monster.com/
➢https://www.careercloud.com/
➢https://www.dice.com/
➢https://www.careerbuilder.com/
➢https://www.jibberjobber.com/
➢https://www.glassdoor.com/index.html


➢ ► RESUME
➢https://zety.com/ 
➢https://www.resumonk.com/ 
➢https://www.resume.com/ 
➢https://www.visualcv.com/
➢https://www.cvmaker.com/
➢https://resumup.com/
➢https://resumegenius.com/
➢https://www.resumebuilder.com/
➢http://www.resumebaker.com/ 
➢https://enhancv.com/


➢ ► INTERVIEW PREPARATION
➢https://www.ambitionbox.com/about-us
➢https://www.acetheinterview.com/ 
➢https://www.geeksforgeeks.org/
➢https://leetcode.com/ 
➢http://www.gainlo.co/
➢https://careercup.com/
➢https://coder.com/careers
➢https://interviewup.blogspot.com/
➢https://www.livecareer.com/resources/inter
views/prep/interviewbest-blog 
➢https://www.indiabix.com/


➢ ► FREE ONLINE EDUCATION
➢https://www.coursera.org/
➢https://www.edx.org/
➢https://www.khanacademy.org/ 
➢https://www.udemy.com/
➢MIT OpenCourseWare 
(https://ocw.mit.edu/index.htm) (Free 
Online Course Materials)
➢https://online.stanford.edu/ 
➢https://www.codecademy.com/
➢(https://github.com/pamoroso/free-python-books)
Learn Python for free
What is MAUI?
Tags: dotnet, mobile, android, ios
Published: 2022-11-13 09:33:37

.NET Multi-platform App UI (.NET MAUI) is a cross-platform framework for creating native mobile and desktop apps with C# and XAML.
Using .NET MAUI, you can develop apps that can run on Android, iOS, macOS, and Windows from a single shared codebase.

Instead of different projects for desktop, mobile, and each OS, all your code is in a single project. .NET MAUI also provides hosting Blazor in MAUI, with embedded web view controls to run Razor components natively on your target device. The decoupled UI and single project enable you to stay focused on one application instead of juggling the unique needs of multiple platforms. It’s the new baby of Microsoft and I know there will be more libraries and the broader ecosystem come alongside .NET MAUI in the following months.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4c42f0zg9b65b79nkef7.png)

**Who .NET MAUI is for? **
.NET MAUI is for developers who want to:

- Write cross-platform apps in XAML and C#, from a single shared 
  codebase in Visual Studio.
- Share UI layout and design across platforms.
- Share code, tests, and business logic across platforms.

**Single project for different platforms**
In new .NET MAUI projects, platforms are placed in a subfolder that gives your focus to your application. Within your project’s Resources folder, you have a single place to manage your fonts, images, app icon, splash screen, raw assets, and styling. .NET MAUI will do the work to optimize them for each platform’s unique requirements.

**Cross-platform APIs for device features**
.NET MAUI provides cross-platform APIs for native device features. Examples of functionality provided by .NET MAUI for accessing device features includes:

- Access to sensors, such as the accelerometer, compass, and 
  gyroscope on devices.
- Ability to check the device's network connectivity state, and 
  detect changes.
- Provide information about the device the app is running on.
- Copy and paste text to the system clipboard, between apps.
- Pick single or multiple files from the device.
- Store data securely as key/value pairs.
- Utilize built-in text-to-speech engines to read text from the 
  device.
- Initiate browser-based authentication flows that listen for a call-back to a specific app registered URL.

**Hot reload**
.NET MAUI includes support for .NET hot reload, which enables you to modify your managed source code while the app is running, without the need to manually pause or hit a breakpoint. Then, your code edits can be applied to your running app without recompilation.

.NET MAUI also includes support for XAML hot reload, which enables you to save your XAML files and see the changes reflected in your running app without recompilation. In addition, your navigation state and data will be maintained, enabling you to quickly iterate on your UI without losing your place in the app.

Will you Learn MAUI?
error: src refspec refs/heads/foo matches more than one
Tags: git
Published: 2022-11-13 09:24:43

If you are getting this error when trying to push a local branch to its remote, it typically means you have tags and branches with the same names. Do:

```
git tag
```

And then delete the tag with the same name as the branch you are trying to push

```
git tag -d refs/heads/production
```

And thereafter avoid using same names for branches and tags as both git and any GUI tools usually run into issues in that scenario.
MongoDB Atlas Hackathon 2022 on DEV
Tags: atlashackathon22
Published: 2022-11-13 09:22:40

## What I built
Realtime Chat Application

### Category Submission:

About Real-time


### App Link


### Screenshots


### Description

- Work in progress for realtime chat using MongoDB Atlas 
 

### Link to Source Code

- https://github.com/AHFoD/realm-web-changestreams-mongodb


### Permissive License

- Apache-2.0 license

## Background
(What made you decide to build this particular app? What inspired you?)
I love challenge. Doing this particular app allow me to test my knowledge for MongoDB usage


### How I built it
(How did you utilize MongoDB Atlas? Did you learn something new along the way? Pick up a new skill?)
I managed to learn a few things 

- How to listen to changes on database in realtime
- Make your own HTTP endpoints with API Service
- Make your own function for the HTTP endpoints


### Additional Resources/Info

- https://www.mongodb.com/docs/atlas/app-services/services/webhook-requests-and-responses/#payload-signature-verification

- https://www.mongodb.com/developer/products/mongodb/real-time-data-javascript/

- https://www.mongodb.com/community/forums/t/webhook-https-endpoint-error-returned-from-postman-no-authentication-methods-were-specified/135538/3
Lusvn - Mua bán hàng hiệu cũ mới
Published: 2022-11-13 09:17:41

Lusvn - Với gần 10 năm kinh doanh và hoạt động trong lĩnh vực mua bán hàng hiệu đã qua sử dụng cùng với nhiều địa điểm thu mua đồ hiệu tại Hà Nội, TP HCM cũng như trên toàn quốc. 
Chúng tôi Lus.vn luôn mang đến cho khách hàng những dịch vụ tốt nhất từ quy trình chuyên nghiệp như: Thu mua, nhận thanh lý ký gửi đồ hiệu các phụ kiện, túi xách. 
Mọi sản phẩm, dịch vụ đến tay khách hàng luôn được chúng tôi kiểm tra kỹ lưỡng dựa trên kinh nghiệm nghề nghiệp cũng như công nghệ hỗ trợ như Check Entrupy giúp xác định sản phẩm chính hãng với an toàn, độ bảo mật chính xác cao.
Uy tín của chúng tôi, sự hài lòng của các bạn chính là đích đến của Lus.vn. Rất hân hạnh được phục vụ mọi khách hàng trên toàn quốc.