teleren/devto huggingface dataset:
Build Fast And Fail Fast - How To Avoid Building a Useless App
Tags: webdev, programming, beginners, management
Published: 2022-12-02 14:48:13

## Introduction
As a developer, I can almost assure you that you have worked on many projects on your own that you have spent countless hours working on, and in the end, none of those projects have seen the light, or even worse, you have worked for months on a project, and you have finally launched it, but no one used it, and no one seemed interested in it.

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

## How Can I Fix This
The MVP methodology (**M**inimun **V**iable **P**roduct) consists of building a product (SaaS, Plugin, App ...) that contains the minimum features required to be a viable customer solution.
The purpose behind starting with an MVP is to test if there is a demand in the market for your product and if there are customers who need it (Product Market Fit) before committing to building a fully featured product.
With this approach, you can launch your product faster, and figure out what works and what doesn't and more importantly what the market expects from your product.

## Expanding
After launching the product and getting some user interactions, you can now be able to determine which features you need to prioritize, and which bugs need an immediate fix, otherwise, you will be dedicating your time and resources to adding features that nobody needs or care about.
Not only that, but you will be able to determine how to expand to a broader market.

## Real World Examples of an MVP
Amazon started as an online shop for selling books, and then it gradually expanded into selling other things, therefore expanding its market.
Also, Facebook started for college campuses (and they initially started only in Harvard) with only 8 features, while other competitors had more features and a broader market, Facebook focused its effort on improving the experience for its initial audience, and gradually expanding its market, and building features accordingly.

## Conclusion
If you take a closer look at this approach, you will find out that in the end, it's about time and energy management, because this approach aims to make sure that you are putting your time and energy into things that matter, instead of relying on your assumptions.

We hope that you liked this short article, and if you did leave us a like, and we will be happy to hear your opinion in the comment section.
teamcity Build Agent doesn't support git-lfs
Published: 2022-12-02 14:38:33

`Failed to perform checkout on agent: /usr/local/bin/git -c core.askpass=/Users/user/Documents/TeamCity/buildAgent/temp/buildTmp/pass -c credential.helper= -c credential.helper=/Users/user/Documents/TeamCity/buildAgent/temp/buildTmp/credHelper.sh checkout -q -f release/2 command failed.
  exit code: 128
  stderr: git-lfs filter-process: git-lfs: command not found
  fatal: the remote end hung up unexpectedly`

`on the Agent side
TEAMCITY_GIT_PATH     /usr/local/bin/git
TEAMCITY_GIT_VERSION     2.38.0.0

TeamCity Professional 2022.10 (build 116751)`


`user@iMac-User-3 ~ % which git-lfs
/usr/local/bin/git-lfs`

Can someone suggest, how to resolve?
End Of Year Fatigue?
Tags: discuss, codenewbie, beginners, productivity
Published: 2022-12-02 14:27:14

Have you reached end of year fatigue? If your answer is yes, then welcome to the club. If your answer is no, then get the fuck out of this post you lucky bastard. Just kidding man, please stay, I'm glad to host you for the next few lines.

I feel like I'm reaching my limit. I feel like a pot of water that's just about to reach boiling temp. and start flowing over onto the stove. 

I've challenged myself to make 2 sites, 2 very important site, 2 potentially life-opening sites. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bscojs9qdysdtf7rihz6.jpg)
I aspire to become a freelance webmaster next year January so that I can overcome my financial woes, But I had 2 problems:

1) People won't hire you if you don't have a site.
2) There has to be a good portfolio to make potential employers trust in your skills.

A month back I solved problem 1 with my own site: https://lithimgwebi.vercel.app/ (check it out if you have the time). Now it was time to solve problem 2.

I could've chosen from a whole host of different sectors to help bolster the portfolio, but I chose to stick to web development and add to my ReactJS knowledge by employing a MERN stack. 

Ultimately it was a good choice because I completed the functionality quite fast, the styling and responsiveness are just the leftover tasks. A friend of mine also asked for a site, so things should be looking up. They truly are, but I just feel like I'm in a rut because of this end of year fatigue.

What're your stories? In what way is the end of year fatigue affecting you?
API route doen't read formData in some cases
Tags: nextjs
Published: 2022-12-02 14:09:58

I have to pass an uploaded image from the NextJS frontend to the NextJS backend. For some other images, the backend code gets the image and with formidable I am able to read its content. For some other PNG/JPG images of 914 KB however, the backend code doesn't seem to be able to run, since it doesn't print out anything in the terminal.

Here is my code:

```
//FRONTEND
const form = new FormData();
form.append("file", file);

fetch("/api/myApiRouteFile", {
method: "POST",
body: form,
})
.then((res) => res.json())
.then((data) => {
console.log("data", data);
})
.catch((err) => {
console.log("err", err);
});
```


```
//Backend code in NextJS API route
import formidable from "formidable";

export const config = {
api: {
bodyParser: false,
},
};

const handler = async (req, res) => {
console.log("CODE RUNNING.... 🚀 "); //with some files, this message is not printed out, so I assume the code was not running. With other images, however, it does, so the code is not always running.

const form = new formidable.IncomingForm();
form.uploadDir = "./";
form.keepExtensions = true;
form.parse(req, (err, fields, files) => {
console.log(err, fields, files); //some images gets printed out, some other no.
});
};
export default handler;
```

Again, when uploading some[](url) images, the backend runs well and prints out the uploaded image file data, but for other images, nothing happens.

Does anyone know what could be the problem? Maybe a max file size? Thanks for the help.

With this image the code works well.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/utq609vjxweg9xv9l5qi.jpeg)

With this other image, the API route code is not running
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/785yvf2241ysh9x6ahy4.jpeg)

Does someone know what may be the problem and solution?
Thanks very much
Difference between let, const, and var (JavaScript)
Published: 2022-12-02 14:02:20

## A Variable
Variables are used to store data (for example age, number, store items, person, etc...). We can declare variables in JavaScript with let, const, and var. 

## Let
Let is used to store a value that needs to change in our code. Example age

```
let age = 30;

//On my birthday
age = 31;
console.log(age); //expected value 31
```

## Const
Const is used to store values that don't need to change(immutable variables). Example birthyear

```
const birthyear = 1992;

//if we try to reassign birthyear we get an error
birthyear = 2000;
console.log(birthyear); //expected value error
```

## Var
Var is just like let meaning you can assign and reassign the value but is an old-school way of using Let.

```
var message = "Hello";
```
PHP 8.1: MySQLi: Bind in Execute
Tags: mysql, php, news
Published: 2022-12-02 14:01:27

PHP have two libraries are mainly used to interact with the MySQL database:
PDO (PHP Data Objects) - a universal driver that allows you to work with various databases, including MySQL
MySQLi (MySQL improved) is an extension of the relational database driver used in the PHP programming language to provide access to MySQL databases.

Although MySQLi shows slightly better performance with prepared statements, in most cases I chose PDO because of its convenient binding syntax.

Just compare:

```
$mysqli_statement = $mysqli->prepare('SELECT * FROM posts WHERE id = ? and author = ?');
$mysqli_statement->bind_param('ds', $postId, $author);
$mysqli_statement->execute();
```
[Test above code on PHPize.online](https://phpize.online/s/yU)

With concise PDO:

```
$pdo_statement = $pdo->prepare('SELECT * FROM posts WHERE id = ? and author = ?');
$pdo_statement->execute([$postId, $author]);
```

[Run code here](https://phpize.online/s/RU)

However, since PHP 8.1, thanks to an [improvement suggested by Kamil Tekiela] (https://github.com/php/php-src/pull/6271)
everything has become much simpler and the syntax of MySQLi has become as pleasant as in PDO:
```
$mysqli_statement = $mysqli->prepare('SELECT * FROM posts WHERE id = ? and author = ?');
$mysqli_statement->execute([$postId, $author]);
```
https://phpize.online/s/DU
The most convenient markdown editor opened in a new browser tab
Tags: productivity, showdev, startup, extension
Published: 2022-12-02 13:52:24

If you're like myself, who prefers to type on a keyboard rather than writing on paper, you probably know that having **another** opened app is a hassle. Either you need to keep the window open or wait until it boots again.

It was so annoying that I decided to build my own product, And my team executed it flawlessly, starting with the branding and ending with the implementation.

[MadNotes](https://madnotes.app) solves the issue above. It provides a place for your brain dump. Nowadays, we do most of our work in the browser. That was the perfect place to put the notepad. But not another web app that's 2137th tab you need to search for! No, no. It opens in **each** new tab and acts like a homepage. Done writing? Just close it. Need to add one more thing? Open a new tab, it's not loading anything from a remote location, so it doesn't slow down your browser. It's just there. I'm personally using it for the daily to-do list and meeting notes.

Lately, we released an initial version - [Chrome](https://chrome.google.com/webstore/detail/madnotes/fmjlhaobdnjacieihgolmlcenngjkibd), [Firefox](https://addons.mozilla.org/en-US/firefox/addon/madnotes/), [Edge](https://microsoftedge.microsoft.com/addons/detail/madnotes/fagamnippkbgkbkindnpgfmpgdncgmjh) extensions, and a [standalone web app](https://use.madnotes.app). Now we're working on the PRO version that will allow syncing the notes across multiple devices, provide the light theme, and a few more customization options. Did I mention the full End2End encryption? Yeah, that's by default.

Let me know what you think about the app! I'm very open to hearing your thoughts and feature requests. Thanks! 🙌
Should I add automated tests for that?
Tags: beginners, testing, testautomation, devops
Published: 2022-12-02 13:38:46

Should I add automated tests for that?

This question is not as easy to answer as it seems. Many teams default to two extreme options:
1) 100% automated tests for everything
2) no time/priority for automated tests

As you can expect neither is a good approach. In the first approach, you risk wasting lots of time on writing automated tests which would have little to no value.

In the second approach, you risk either having a big number of issues or spending lots of time and money on manual testing afterwards.

As always there's no right or wrong way here, however, there're some heuristics that can help you with this decision. I have created this mind map as a place to start: https://xmind.works/share/eZRBam34

If you have improvement suggestions please add them in the comments!

Please follow me for more posts on software development and test automation

Feel free to subscribe to my Youtube channel: https://www.youtube.com/channel/UCkJRvCK2-l2gCuPT9-HUG7A

My website is here: https://testclub.notion.site/
Teori Logika dan Algoritma Pemrograman
Tags: algorithms, logic, programming
Published: 2022-12-02 13:30:45

## Pengertian Logika dan Algoritma

Yaitu kemampuan seorang manusia untuk berfikir dengan akal tentang suatu permasalahan menghasilkan sebuah kebenaran, dibuktikan dan dapat diterima akal.

**Logika** identik dengan masuk akal dan penalaran. Penalaran adalah salah satu bentuk pemikiran. Pemikiran adalah pengetahuan tak langsung yang didasarkan pada pernyataan langsung pemikiran mungkin benar dan mungkin juga tak benar. Definisi **logika** sangat sederhana yaitu ilmu yang memberikan prinsip-prinsip yang harus diikuti agar dapat berfikir valid menurut aturan yang berlaku.

**Logika** berasal dari dari bahasa Yunani yaitu LOGOS yang berarti ilmu. **Logika** dapat diartikan ilmu yang mengajarkan cara berpikir untuk melakukan kegiatan dengan tujuan tertentu. **Algoritma** berasal dari nama seorang Ilmuwan Arab yang bernama [Abu Jafar Muhammad Ibnu Musa Al Khuwarizmi](https://en.wikipedia.org/wiki/Muhammad_ibn_Musa_al-Khwarizmi) penulis buku berjudul [Al Jabar Wal Muqabala](https://www.academia.edu/27116026/THE_BOOK_AL_JABR_WA_AL_MUQ%C4%80BALAH_A_RESEARCH_ON_ITS_CONTENT_WRITING_METHODOLOGY_AND_ELEMENTARY_ALGEBRA_BY_AL_KHW%C4%80RIZM%C4%AA).

**Algoritma** dapat diartikan urutan penyelesaian masalah yang disusun secara sistematis menggunakan bahasa yang logis untuk memecahkan suatu permasalahan.

Meski demikian terdapat beberapa definisi **algoritma** yang lain. Diantaranya menurut Rinaldi Munir, **algoritma** adalah urutan langkah-langkah logis penyelesaian masalah yang disusun secara sistematis. Sedang menurut Kamus Besar Bahasa Indonesia, definisi **algoritma** adalah urutan logis pengambilan keputusan untuk pemecahan masalah. Menurut tim Gunadarma:1988, **algoritma** adalah suatu himpunan berhingga dari instruksi-instruksi yang secara jelas memperinci langkah-langkah proses pelaksanaan, dalam pemecahan suatu masalah tertentu, atau suatu kelas masalah tertentu, dengan dituntut pula bahwa himpunan instruksi tersebut dapat dilaksanakan secara mekanik. 

Dari pengertian diatas maka dapat disimpulkan bahwa **Logika** dan Algoritm aadalah ilmu yang mempelajari cara penyelesaian suatu masalah berdasarkan urutan langkah-langkah terbatas yang disusun secara sistematis dan menggunakan bahasa yang logis dengan tujuan tertentu.
Statikly - No hassle full stack framework
Published: 2022-12-09 14:09:59

---
title: Statikly - No hassle full stack framework
published: true
date: 2022-12-02 13:27:34 UTC
tags: 
canonical_url: https://blog.niradler.com/statikly-no-hassle-full-stack-framework
---

[Statikly](https://github.com/niradler/statikly) is a full-stack framework for developers who want to create SSR/static sites, great for blog/static/content sites, and amazing for prototype and building internal tools and SEO optimisation.

Provide an alternative for writing frontend with endless packages and single page application frameworks like React/Vue, more and more heap is growing on server side UI, like next.js and remix, and I wanted to simplify it even more.

Statikly is based on [fastify](https://www.fastify.io/) framework and ecosystem plugins, it's trying to not be very opinionated but to support strong defaults.

let's create our first project

```
npm i -g statikly nodemon
mkdir statikly
cd statikly
statikly init # clone niradler/statikly-demo
npm run watch # visit localhost:3000

```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1669985493918/d1a80db3-dbb8-4f63-9217-e8e990f6f618.png)

The code behind this page can be found in `views/index.ejs` if you wonder where the rest of the HTML coming from we use the layout feature, the page layout is at `partials\layout.ejs` configured as env var

```
STATIKLY_LAYOUT=./partials/layout.ejs

```

in `.env` make sure you don't commit `.env` with secrets to git.

```
<section>
  <h1>Todo example</h1>
  <a href="/todos"><button>My Todos</button></a>
</section>

<figure>
  <img src="public/image.jpg" alt="Minimal landscape" />
</figure>

```

Go ahead and play with the demo todo app to figure out how you can pass data to your view with loaders, checkout the todos loader for example `views\todos\loader.js`

Supported env vars:

```
NODE_ENV=production # optional: set in production
STATIKLY_ROOT= # optional: set to override current folder
STATIKLY_STATIC_FOLDER=public # optional: for other public folder
STATIKLY_TEMPLATE=ejs # optional: template engine to use for the complete list @fastify/view
STATIKLY_LAYOUT= # optional: layout path
STATIKLY_VIEWS=views # optional: for other views folder
STATIKLY_PASSWORD=1234 # optional: basic auth
STATIKLY_USERNAME=user # optional: basic auth

```

Another helpful command wil be running `statikly --help`
Follow Friday: DevOps Edition (2 December 2022)
Tags: meta, writing, devops
Published: 2022-12-02 13:18:00

_Happy Friday, friends! 🎉 Follow Friday is your weekly opportunity to shout out fellow DEV Community members doing awesome work. Check out the comments and follow someone new!_

[DevOps](https://en.wikipedia.org/wiki/DevOps)! You've probably heard of it by now, but in case you haven't (or you've just been putting off learning what it means 😅), here's the scoop: DevOps is a set of practices combining development and IT operations to make processes shorter and more efficient. Its aim is to provide continuous delivery and improve software quality. The name DevOps is a [portmanteau](https://en.wikipedia.org/wiki/Portmanteau) of "Developer" and "Operations."

Speaking of, if you're into writing and reading about DevOps, I recommend checking out our friends over at [The Ops Community](https://community.ops.io/) Forem!

{% embed https://community.ops.io/ %}

So, devs (and ops): who are your favorite DEV community members writing in the DevOps space?

_**Formatting tip**: to populate a card with a follow button, use the liquid tag syntax `{% embed https://... %}` and insert the URL of your favorite author's profile._

Join in on the #FollowFriday fun by @mentioning your favorite author to follow on the topic of DevOps (and letting us know why you love their posts!) ⤵️
Inline vs. block-level elements
Published: 2022-12-02 08:38:48

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3xmcur4ii44b0up4excx.jpg)


There are many definitions about this topic. And as a developer it is a need to know more in this topic! so, let's see how important and useful to us!

HTML (HyperText Markup Language) elements historically were categorized as either "block-level" elements or "inline-level" elements. First let see about inline elements,

# **Inline elements:**
 
### An **inline element** does not start on a new line. An inline element only takes up as much width as necessary.


#### This is a `<span>` element inside a paragraph.

```
<!DOCTYPE html>
<html>
<body>

<p>This is an inline span <span style="border: 1px solid black">Hello World</span> element inside a paragraph.</p>

<p>The SPAN element is an inline element, and will not start on a new line and only takes up as much width as necessary.</p>

</body>
</html>

```

####  Here is a list of common inline elements

`<a>
 <img>
 <small>
 <script>
 <strong>
`

I have stacked up multiple inline elements together. 

```
<a href="#">Link</a>
<img src="" />
<small>The text gets become smaller</small>
<script>src=""</script>
<strong>React</strong>

```

# **Block-level elements:**

###### A  **Block-level** **element** always starts on a new line, and the browsers automatically add some space (a margin) before and after the element.

##### A block-level element always takes up the full width available .Two commonly used block elements are: `<p> and <div>`

```
<!DOCTYPE html>
<html>
<body>

<p style="border: 1px solid black">Hello World</p>
<div style="border: 1px solid black">Hello World</div>

<p>The P and the DIV elements are both block elements, and they will always start on a new line and take up the full width available (stretches out to the left and right as far as it can).</p>

</body>
</html>

```

######  Here is a list of common Block elements. I have attached some common block elements together.

`<h1 - h4>,<header> and <section>`

```
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
```
```
<header>
    <h1>A heading here</h1>
    <p>Posted by John </p>
    <p>Some additional information here</p>
</header>
```
```
<section>
<h2>WWF's Symbol</h2>
<p>The Panda has become the symbol of WWF. The well-known panda logo of WWF originated from a panda named Chi Chi that was transferred from the Beijing Zoo to the London Zoo in the same year of the establishment of WWF.</p>
</section>
```

And here are some useful references.

Full list of block level elements:[https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements#Elements]

Full list of inline level elements: including inline-block elements:(https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements#Elements)

Thank you for reading!
INTRODUCTION TO PYTHON (For and while loops and STRINGS)
Published: 2022-12-02 12:54:30

## While loops:
With the while loop we can execute a set of statements as long as a condition is true.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pg2ra2vssacywtynbxy7.png)
**break statement:**
It is a loop control statement. Suppose you want to terminate a loop and skip to the next code after the loop; break will help you do that. It is used after the loop statements.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fikulwq3yehkypcf60xt.png)
**continue statement**
With the continue statement we can stop the current iteration, and continue with the next.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4odso6wrmqmgnk0hjwjf.png)
## for loops:
A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ph6czi7vwns16hbv2n2.png)
**Range() function**
The range() function returns a sequence of numbers, starting from 0 by default, and increments by 1 (by default), and stops before a specified number.
range(start,stop,step)
start: Optional. An integer number specifying at which position to start. Default is 0
stop: Required. An integer number specifying at which position to stop (not included).
step: Optional. An integer number specifying the incrementation. Default is 1.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mw6j7bsmsuyqri2m0g33.png)
## STRINGS
A string (str) in Python is a single character or a collection of characters. Strings in python usually represented by double or single quotation.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2plhpfy3nxlabwuu5zjc.png)

If we want to print multiple lines of strings, we just have to follow these steps:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hr4drxp0ccvas3i4qs5g.png)

**len() function**
The len() function returns the length of a string:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c5v4z4r55ps32djamun9.png)
**Indexing**
We can access every element in strings by indexing. There are two types of indexing one is positive indexing and another one is negative indexing.
Positive indexing:
Positive indexing starts from 0 and ends at (length of a string -1).
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/islvwnn3f8r0d8otda02.png)
Negative indexing:
Negative indexing starts from -1 and -length of string.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqm2xzwpaossjbe2hxf3.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/phu546ttjmpgms3h8z77.png)
_Strings are immutable. Once a string is created the characters on it can't be changed or deleted. _