teleren/devto huggingface dataset:
Lessons from open-source: Partytown — a library that uses web worker to run third party scripts.
Tags: javascript, node, nextjs, opensource
Published: 2024-03-14 22:31:02

This lesson is picked from [Next.js source code](https://github.com/vercel/next.js/blob/canary/packages/next/src/pages/_document.tsx#L216). In this article, you will learn what a Partytown library is and where to find the code related to Partytown in Next.js

## What is a partytown?

[Partytown](https://github.com/BuilderIO/partytown) is an open source library built by [Builder.io](http://builder.io/) to relocate resource intensive third-party scripts into a web worker so that main thread is dedicated to your code.

> Partytown is a lazy-loaded library to help relocate resource intensive scripts into a_ [_web worker_](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API)_, and off of the_ [_main thread_](https://developer.mozilla.org/en-US/docs/Glossary/Main_thread)_. Its goal is to help speed up sites by dedicating the main thread to your code, and offloading third-party scripts to a web worker. —_ [_Source_](https://partytown.builder.io/)

Keep in mind, this library is still in beta and cannot be guaranteed to work in every scenario.

I found the following concepts that require further reading:

1.  [Web worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API)
    
2.  [Main thread](https://developer.mozilla.org/en-US/docs/Glossary/Main_thread)
    
3.  [Critical rendering path](https://web.dev/articles/critical-rendering-path)
    
4.  [Partytown, Google Slide Presentation](https://docs.google.com/presentation/d/10aKHUokby6hQydL_xuOtct4CPwAkgay5l0-FqgO8-3g/edit)
    
## Where to find the code related to Partytown in next.js?

![Partytown](https://media.licdn.com/dms/image/D4E12AQGrFXMtTTtFjg/article-inline_image-shrink_1500_2232/0/1710454445751?e=1715817600&v=beta&t=Do2YJ8_OioZb2ijdJ7N7o1ysRTnx9GRDjq8a3eC-CYA)

Notice that Partytown is not bundled in the next.js source code, [it is supposed to be like that](https://partytown.builder.io/getting-started).

> [Practice the exercises based on documentation](https://tthroo.com/) _to become an expert in Next.js_

## Different ways to install Partytown in Next.js:

1.  [**Add Partytown type attribute to Third-Party Scripts**](https://partytown.builder.io/partytown-scripts)    
2.  [**Add Partytown snippet to the <head>**](https://partytown.builder.io/integrations)    
3.  [**Copy Partytown library files**](https://partytown.builder.io/copy-library-files)
    
## Conclusion:

I came across Partytown built by [Builder.io](http://builder.io/) when I was reading the [pages/\_document.tsx](https://github.com/vercel/next.js/blob/canary/packages/next/src/pages/_document.tsx#L216) in the Next.js source code and wanted to find out what it is about. 

Partytown helps to speed up sites by running third party scripts in a web worker and this allows the main thread dedicated only to your code. Partytown is still in beta and not guaranteed to work in every scenario. This also made me read the MDN docs related to web workers.
$HOT is already traded on WhiteBIT Perpetuals 📈
Published: 2024-03-14 22:18:06

$HOT  is already traded on WhiteBIT Perpetuals 📈

The WhiteBIT exchange decided to support HOT Wallet and has already launched $HOT futures trading. Spot trading has not yet been opened 🛠️

The price of HOT at the time of writing this post is ≈$2.3 💰

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7mwbsp65u7ggwk3u6e2z.png)
Mastering Cross-Platform App Development: From iOS to Android with Flutter
Tags: flutter, android, development, programming
Published: 2024-03-14 22:16:04

Listen up, folks! In this crazy world of mobile apps, we're all looking for that one-size-fits-all solution that can save us from the nightmare of writing separate codebases for iOS, Android, and every other platform under the sun. Enter Flutter, the open-source UI framework that's here to save the day (and our sanity)!

Developed by the geniuses at Google, Flutter is like the Swiss Army knife of app development. With its ability to create natively compiled applications for mobile, web, and desktop from a single codebase, it's like having a magical wand that can conjure up apps for any platform you desire. Talk about efficiency!

But what really sets Flutter apart is its promise of code reusability and UI consistency. Imagine being able to write code once and have it work seamlessly across iOS, Android, and other platforms. It's like having a universal remote control for your apps, ensuring that your users get the same awesome experience no matter what device they're using.

Now, let's talk about the secret sauce behind Flutter: Dart. This modern programming language developed by Google is like the cool kid on the block. It's object-oriented, easy to learn, and packs a serious punch when it comes to performance. With its ahead-of-time (AOT) compilation, Flutter apps start up faster than you can say "hot reload" (which, by the way, is another nifty feature that lets you see changes in real-time, because who has time for boring old rebuilds?).

But wait, there's more! Flutter's reactive programming model and rich widget library are like having a box of Lego bricks for building stunning user interfaces. From animations that'll make your eyes pop to gestures that'll have you swiping left and right like a pro, Flutter has everything you need to create truly immersive and engaging mobile experiences.

And let's not forget about Flutter's vibrant ecosystem. It's like having a giant playground filled with tools, libraries, and resources to fuel your creativity. From state management solutions like Provider and Bloc (because who doesn't love a good state party?) to popular UI libraries like Flutter Cupertino and Flutter Material, you'll have access to a treasure trove of building blocks to create polished and feature-rich applications.

So, whether you're a seasoned app developer or just starting, Flutter is the path to cross-platform app development nirvana. With its code reusability, UI consistency, and robust ecosystem, Flutter empowers you to deliver exceptional user experiences across multiple platforms, all while saving time, money, and your precious sanity.

Embrace the Flutter revolution, my friends, and join the ranks of app development superheroes who are changing the game, one cross-platform app at a time!
The Reality of Working At A Startup (My Experience)
Tags: softwaredevelopment, startup, softwareengineering, programming
Published: 2024-03-14 22:13:44

After working for a startup for 6 months, I felt the need to share my experience working at a startup company. I address some of the pros and cons of working at a startup.
{%youtube twJ2UWA6eXo%}
Create instant aliases
Tags: opensource, linux, showdev
Published: 2024-03-14 21:55:43

Here is Ali, my first open source tool: [https://github.com/janpmz/ali](https://github.com/janpmz/ali)

Press the up arrow and just add the following infront of the last command:
**ali aliname**

And use **alianalyze** to find frequent commands in your history, then turn them to aliases!

I would love your feedback!
Will AI put an end into the Software Engineer Developer career?
Tags: career, ai, softwareengineering, developer
Published: 2024-03-14 21:55:22

Don't study Computer Science, neither programming, 'cause everyone is now a programmer, says the guy from Nvidia.

Devin is the new AI Software Developer that will replace us all, says the Human Software Engineer from Cognition who works to put an end to his own job.

And many others...

I just needed to write about it right now because there is a lot of panic going on with these subjects.

Before it was Don't study Java 'cause it's a dead language, study this or that.

And now we are facing this Phantom Menace (I hope you guys get the reference :D).

What I really think about it is that we'll have plenty of work, at least for the next decade or more.

These automated AIs can be our tools or help us get started with things, but I really don't believe that they will replace all Software Engineers, especially for two factors: cost and documentation.

[Seeing Devin in action](https://twitter.com/cognition_labs/status/1767548763134964000?t=wMGwK-6Z81c5k5LruZL2iQ&s=33 "Seeing") just lets me think about it; it relies on documentation to figure out how things work, but in the real world, if you have ever worked with software development, especially with legacy applications and financial systems with crazy integrations, you know that it is far from being the reality of it. Sometimes, you will need more people skills to get in touch with people who have already discovered those legacy systems, to be able to do what you need to do. And as far as I know, Devin cannot interview you, yet.

On the other hand, the cost of processing for these AIs will probably reach sky-high, and paying your salary will be much more cost-effective.

And even if you believe in the guy from Nvidia, let's suppose that everyone is now a programmer, okay. So now, the companies will need to describe it so accurately to the AI developer what they want. And all the changes that they want in the next week. And the other changes. And so on and so forth...

How do you believe that will end this code? I can imagine a total mess of complexity and unnecessary things. Let's put it in an image to illustrate better:

![future of AI engineers](https://igorfragadev.com/wp-content/uploads/2024/03/image-3-1005x1024.png)This is much of what I see for the future of AI engineers.

And if you want to discuss that, I'll have a whole conversation with an awesome team of engineers from all around the world about that in the next The Out of the Box Developer live session on the [SouJava Youtube channel](https://www.youtube.com/@SouJava/ "SouJava") next Monday, March 18, at 5 PM EST / 21:00 GMT. Join us, bring your questions, and let me know in the chat that you are joining the live after knowing it from this post.

[If you want to be alerted when the live is going to start, subscribe to my mailing list below, and you will receive an email with the link directly to the live some minutes before it starts.](https://igorfragadev.com/newsletter/)

Take care and see you in the next post!
String Interpolation/Refactoring in Ruby
Tags: webdev, beginners
Published: 2024-03-14 21:37:00

You can always add `+` or `<<` to add a variable value into a string `"#{interpolation}"`

Refactoring - fancy way of saying we're improving the structure or appearance of code without changing what it actually does.
   Omit needless words
   Make sure to us the when defining methods
   Using `puts` inside methods is generally discouraged if the  methods are meant to be used as part of a library or for refactoring values as it can lead to unwanted console output. `puts` is mostly used for debugging or for scraping that interaction directly with the user via the terminal.
Day 927 : Misunderestood
Tags: hiphop, code, coding, lifelongdev
Published: 2024-03-14 21:21:57

_liner notes_:
- Professional : So many meetings!!! haha For the rest of the day, worked on tasks that either people needed from me or I would need for someone to review. Not a bad day.

- Personal : Last night, I went through a bunch of tracks for the radio show and put them in playlists. Also purchased some tracks from Bandcamp and put together my social posts.

![A lush green forest with a path running through the middle. The trees are tall and have thick green leaves. The path is made of dirt and is surrounded by tall grass. The sun is shining through the trees, creating a dappled pattern on the ground. The forest is dense, humid, and located in Abeokuta Forest, Nigeria](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/al82nmu1m9pccr2hlbyi.jpg)

Not sure what is happening with the AI I use to generate the alt text. It was spitting out Chinese for the description. I had to add "in English" to my prompt. It was the exact same prompt as my previous runs that worked so it's not like it misunderstood or anything. Then it would cut off the last sentence. Had to rerun it a few times. Finally got something usable out of it and kept it moving. Going to do a little work on the radio show. Got a bunch done last night, but I really need to get some work done on my side project. There's one feature I want to get working and then start copying over the code to a fresh new updated instance. About to eat dinner and get to work.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube -kGGPII1K4I %}
Escaping from being stuck in the optimization trap
Tags: programming, productivity, development, softwareengineering
Published: 2024-03-14 21:01:57

I've been meaning to write a post on here for a while, but we all know how it goes. Distractions, busy, other projects, not enough time.

But I had an interesting epiphany the other day. One that I thought was worthwhile sharing. Because everyone has their own experiences and ways to get unstuck.

As I was stuck on refactoring something and reflecting the best approach, I was thinking about it as "what is the smartest way to solve this? and more so "what exactly am I trying to solve and what is the smartest way to do this?".

And that's when it struck me.

Sometimes the smartest way to do a thing is to not do it in the smartest way (possible).

We can always optimize the optimizations and abstract them further. But is there an actual tradeoff for doing this? Or are we simply trying to optimize it for the sake of optimizing? Are we abstracting for the right reasons or just because it's the way that we tend to do things?

So for future cases, if I feel I'm stuck on a problem, I'm going to try to remember to ask myself this:

Am I trying to optimize the optimization?
(And can I settle for good/close enough?)

Because sometimes two pieces of code is better than (a more complex unified) one.

But I would certainly be curious to hear opinions from the community.

[Image Source](https://unsplash.com/photos/man-wearing-white-top-using-macbook-1K9T5YiZ2WU)
Prelude to react-hook-use-cta (useCTA)
Tags: react, reacthook, typescript, hooks
Published: 2024-03-14 20:57:14

## Introduction

In the past, I found myself writing a `React.useReducer` hook that did common patterns of updating, setting, or comparing my current state with previous or initial state. Instead of having to rewrite this hook everywhere I went, I decided to turn it into a hook library in case I needed it in other projects. 

It's current version is in prerelease version 0.0.1 since I think the Typescript and some of the API could be improved.

I provided extensive documentation on the hook's API in the [README.md](https://github.com/rafde/react-hook-use-cta) and provided a [Demo playground](https://codesandbox.io/p/sandbox/react-hook-use-cta-7jnc32?file=%2Fsrc%2FApp.tsx%3A34%2C25) for people to see the hook in action. 

I did what I could to help intelli-sense through Typescript when it comes to defining custom actions and dispatch parameters.

I want to send this out into the wild to see if it helps and get some input. Thanks for reading.
Streamlining Your Dev Environment with House Cleaning Techniques
Published: 2024-03-14 20:45:23

Ah, the developer environment. A place of endless creativity and innovation... and sometimes, overwhelming clutter. Just like a messy house, an unorganized dev environment can hinder your productivity and creativity. Here's where we can apply some good old-fashioned house cleaning techniques to our coding haven. Just as [One Cleaning Adelaide](https://onecleaning.com.au) transforms homes with their impeccable services, let's apply some of their techniques to declutter and optimize our developer environments.

The Daily Tidy-Up:

Version Control Hygiene: Regularly commit your changes and clean up your branch history. Squash unnecessary merges and delete local branches you no longer need. This keeps your Git repository clean and easy to navigate.
Clear Your Cache: Cached data can sometimes lead to unexpected behavior. Clear your IDE's cache and temporary files to ensure everything is running smoothly.
Close Unused Tabs and Files: Open browser tabs and lingering code files can create visual clutter and slow down your computer. Close what you're not actively using.
The Weekly Deep Clean:

Dependency Detox: Review your project's dependencies and remove any unused or outdated libraries. This can streamline your codebase and improve security.
Organize Your Codebase: Refactor your code to improve readability and maintainability. Group related functions and classes logically.
Clean Up Documentation: Ensure your documentation is up-to-date and reflects the latest code changes. This saves time and frustration for you and your teammates.
The Quarterly Spring Cleaning:

Revisit Old Code: Take a deep dive into legacy code and identify areas for improvement. Consider refactoring or rewriting critical sections.
Archive Old Projects: Not everything needs to live on your local machine forever. Archive old projects you're no longer actively working on to free up space and declutter your development environment.
Upgrade Tools and Frameworks: Review your development tools and frameworks. Update to the latest versions to benefit from bug fixes, security patches, and new features.
Bonus: Automation for Efficiency

Version Control Hooks: Implement pre-commit hooks in Git to automatically check for code style violations, formatting issues, or missing tests before committing code.
Static Code Analysis Tools: Utilize static code analysis tools to identify potential bugs, security vulnerabilities, and bad coding practices early on.
Continuous Integration/Continuous Delivery (CI/CD): Set up a CI/CD pipeline to automate tasks like building, testing, and deploying your application. This reduces manual work and ensures consistency in your development process.
By incorporating these house cleaning techniques into your development workflow, you can create a more organized, efficient, and maintainable codebase. This allows you to focus on what truly matters -  writing brilliant code!
Starcoder2 vs Gemma:2b LLM
Tags: llm, starcoder2
Published: 2024-03-14 20:11:17


Today, I installed Starcoder2 and gemma:2b LLMs locally using Ollama, to the surprise, both are not giving proper results for my prompts.
When attempting to use Gemma:2b, I received misinformation that prompted me to install or use an unknown dependency. This led to pubsub being unable to locate the required dependency.

Here are two examples of the issues I encountered:


1. Creating flutter app.

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


2. Creating Chrome extension.


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


2. Here is the gemma:2b's dependency that went wrong.
Please suggest me how to find this dependency 

import 'package:google_sheets_api/google_sheets_api.dart';

I only found this one instead

https://pub.dev/packages/gsheets

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mevqxntqhfyd3vggdrna.png)
Postman Student Leader answers(January 2024 )
Tags: student
Published: 2024-03-14 20:10:04

> Please list student communities that you are part of, and in what capacity. As part of the Student Leader program, you will get support in building and participating in student communities. Knowing your current experiences in this area will help us better understand your starting point. (255 word limit)

I am the founding GDSC Lead of my college,built from the scratch, & have hosted all the sessions for it, which now has over 200 members. I volunteer for community events, & even be a speaker in some. More details can be found in my LinkedIn profile.

> How would you explain APIs to your grandparents in 2 minutes? Explain what APIs are in a video under 2-minutes You don’t need to edit the video, make a presentation or add sound effects. Just record a video explaining APIs in simple words with your mobile phone or webcam and share the link here. (You can upload it to Google Drive or YouTube and keep it unlisted, make sure video is accessible via a link, or use a video service like Loom)

Here is a transcript of the video answer which I submitted.

Imagine that you want to order chocolates from paris, & you don't know french. There's a translator available, & you take their help which is just like using an application programming interface i.e. API.
They allow you to easily communicate your order to the cashier, which can be imagined as the computer, who understands the request, all thanks to the translator, & sends the order via the translator, relating to a GET request.
API can be a helper that lets different systems communicate with each other easily without the user needing to know all the technical details. It takes your request, translates it, brings the answer, just like the example told before. 

> What is your favorite Postman feature and why? What is the feature you love the most in Postman and how does it help you in your day-to-day life?

The Documentation is neat, while the Markdown brings some spice to the otherwise long lines of prose. Simulation of API endpoints with a mock server is a lovable feature, as it is a banger when I don't prefer not to run my requests against real data.

> How would you promote API literacy among students on your campus? Our Goal is to promote API Literacy. As Postman Student Leader you will be helping us make your campus API Literate. Give us some examples of how you would promote APIs among students.

There are a number of ways in which I can do that:
-By hosting sessions. I recently helped a few of my friends earn the postman student expert badge.
-By crafting detailed blogs about how to use postman APIs in daily coding, aimed exclusively for students.
Exciting Opportunity for Senior Android OS Engineer
Tags: androiddev, career, programming, algorithms
Published: 2024-03-14 19:53:57

---
title: "Exciting Opportunity for Senior Android OS Engineer"
description: "Join a dynamic tech team revolutionizing the human experience."
tags: [androiddev, career, programming, algorithms]
---

Are you a seasoned Senior OS Engineer with a knack for diving deep into Android-based systems? If so, this is an opportunity where innovation knows no bounds and lines of code weave the fabric of tomorrow's reality. We’re currently on the lookout for a talented individual like you to join our dynamic tech team.

**Company Overview:**
A web3 infrastructure & hardware company. Forward-thinking by revolutionizing the human experience through innovative hardware and software solutions. Rewriting the playbook on human-computer interaction. Backed by a symphony of visionary investors raised $14 million (seed round) to fuel their mission of bridging the physical and digital realms.

**About You:**
Senior OS Engineer with at least 5 years of experience in OS development, ideally with expertise in the Linux kernel, Android Runtime (ART), and/or core Android frameworks. You have experience with hardware interfaces and custom Android distributions, as you’ll be contributing to the development of low-level system components to ship innovative spatial computing products.

**Requirements:**
- Proficiency in C, C++, Java, Kotlin, or Kernel.
- Experience working with any core Android frameworks such as: AOSP, ART, NDK, SDK, HAL – to name a few…
- 3-5 years of experience in OS engineering

**Nice to Haves:**
- Familiarity with augmented reality and spatial computing.

**Location:**
We're looking for candidates located in the United States, preferably near Los Angeles, but we're open to applicants from anywhere in the USA.

**How to Apply:**
If you're ready to dive into cutting-edge tech projects and contribute to groundbreaking innovations, feel free to start the conversation with a simple message to [@SpatialSenseiSeeker](https://dev.to/SpatialSenseiSeeker) or directly via email by clicking [here](mailto:tommyhaugh@gmail.com). We can't wait to hear from you!

With Enthusiasm I Remain,  
Tommy
[@SpatialSenseiSeeker](https://dev.to/SpatialSenseiSeeker)