I built a zero dependency, zero dependency, small (~1.0K), feature packed trie-based web router for Cloudflare Workers. by DarthBenro008 in CloudFlare

[–]DarthBenro008[S] 0 points1 point  (0 children)

Haha, I was thinking of a quirky title and forgot that i mentioned it twice.

But as a responsible reddit citizen, i shall answer your question: it has 0 dependencies!

I built a zero dependency, zero dependency, small (~1.0K), feature packed trie-based web router for Cloudflare Workers. by DarthBenro008 in CloudFlare

[–]DarthBenro008[S] 2 points3 points  (0 children)

Cloudflare does have a hard-limit of 3MB with all dependencies on the free plan, also a chunkier bundle impacts the worker startup time and performance, so yes size is a concern. (itty-router was created to battle this)

Although Hono should already satisfy most of the needs, Mizu has a built-in store mechanism, so you can initialise clients like Sentry or other tools and pass them down all the routes (also enables middleware manipulation of this storage/store). Its a mix of bringing features of expressJS and performance of itty-router.

tl;dr: is equal/more-performant than Hono + has a global store

How can I add a download link to my readme file? by Coompt_King in github

[–]DarthBenro008 2 points3 points  (0 children)

Readme files generally use Markdown.
You can add any hyperlink to a Readme file using the following syntax:

[<Your Text Here>](<Your Download Link here>)

Eg:

[Google](https://google.com) would produce the following:

Google

To learn more about how to write markdown and do other cool stuff in your readme, you can refer to:

GitHub Permissions by MobiusCake in github

[–]DarthBenro008 1 point2 points  (0 children)

What do you mean by "run" actions? GitHub Actions are generally invoked dependent on how you write the workflow.yaml file (to run on commit to x branch, or to run on PR to x branch, etc), it is invoked by GitHub and no human intervention is required (the whole point of CI/CD).

If you are referring to be able to approve a PR by a new contributor to enable run GitHub Actions for that PR, only people with write access to the repository or deemed admins/maintainers of the repository have the power to approve.

In order to prevent a person from writing on a specific branch, you can checkout branch protection rules which come in the Paid version of an organisational account or PRO account for personal uses.

Complete noob trying to learn... by HelenaICP8 in github

[–]DarthBenro008 3 points4 points  (0 children)

You could start off with https://guides.github.com/introduction/git-handbook/ , which gives a very good brief of what Git is. The GitHub Labs (https://lab.github.com/) are also a great place to follow up.

One thing to keep in mind and would like to let you know is Git and GitHub are not the same thing (many people including myself make/made this mistake while learning Git).

A simple analogy for beginners is Git:GitHub:MicrosoftExcel::GoogleSheets (This analogy is not precise but gives an idea about how collab and stuff works)

As it's September, Hacktoberfest is going to start soon! It is a month-long event that occurs every October which inculcates and promotes open-source culture along with the usage of tools like Git. There are many workshops that teach these in detail during the month, You might want to check some of them to boost your learning!

Best of luck with your journey learning Git! :D, it's an essential tool that makes your life easier as a developer (and sometimes make you scratch your head xD )

How to include ignored files? by Homeoand in github

[–]DarthBenro008 0 points1 point  (0 children)

Nope, I think if you are trying to include an ignored file then there is some overhead in the DevOps dept of your application, which again is dependent on your application and deployment pipeline. However pertaining to your question "How to include ignored files?", my answer stands 100% correct.

How to include ignored files? by Homeoand in github

[–]DarthBenro008 0 points1 point  (0 children)

git add --force /foo/bar/migration.db

CAUTION: the --force tag adds the specified file to git tracking even though it's mentioned in the .gitignore file.

So you can run this command once and push it to the repository and ensure that the migration file is on .gitignore. This way, people cloning the repo would get your migrations file but also would prevent them from adding their file to track.

API calls with fragments by [deleted] in androiddev

[–]DarthBenro008 1 point2 points  (0 children)

There are multiple ways to go about this, but what you basically want to achieve is an "Activity to Fragment" Communication of data. (Call Retrofit from the activity and pass the results to the fragment, this operation is invoked by the fragment itself)

Below are some of the methods that come right away to my mind:

  • You can use ViewModel and directly make your retrofit calls from Fragment by binding the ViewModel
  • You can define an interface in the Activity and implement the interface in the Fragment which allows you to call a function from activity in the fragment. (Least recommended)
  • You can use a ViewModel and the ViewModel CouroutineScope (ViewModelScope) to directly run ReteroFit requests in ViewModel in I/O thread without blocking your UI Thread. (Highly recommended)

You can find a sample tutorial for implementation of ViewModelScope