Posts

Showing posts from June, 2023

.dev.tt domain names in Trinidad and Tobago

I have this idea where developer hub members could be given .dev.tt domain names. I asked ChatGPT to help me express the benefits of this. Acquiring .dev.tt domain names for d'hub members in Trinidad can provide several benefits. Here are ten advantages to consider: 1. Relevance : A .dev.tt domain extension immediately signifies that the website is related to developers or development, enhancing the overall relevance and branding of d'hub members' websites. 2. Credibility : Having a dedicated domain extension like .dev.tt adds credibility and professionalism to the websites of d'hub members, demonstrating their commitment to the developer community. 3. Memorability : A unique domain extension like .dev.tt helps in creating memorable website addresses, making it easier for visitors to recall and revisit d'hub members' websites. 4. Differentiation : By using .dev.tt domain names, d'hub members can distinguish themselves from other websites that use more common

Part 2 - An Example of Using Next.js for Static Site Generation on Android with Termux

Image
See also part 1 -  https://trinbagotechie.blogspot.com/2023/06/part-1-example-of-using-nextjs-for.html It turned out to be as simple as importing the json file directly. What pointed me in that direction was this Stack Overflow  https://stackoverflow.com/questions/73090440/is-it-nessesary-to-use-getstaticprops-with-json-import-in-next-js I also discovered basePath config option which is useful for github pages. I also read that getStaticProps uses caching so it would be a better option in that sense rather than importing the json file directly. But that would apply if I was running my app as a server app. A lot of places tell you JSX expressions must have one parent element and show you how to use fragments and short syntax with empty tags but they don't explain why there is this "limitation". This blog post explains it. https://dillionmegida.com/p/why-jsx-expressions-must-have-one-parent/ I found this React explainer video useful https://youtu.be/s2skans2dP4 And this is

Part 1 - An Example of Using Next.js for Static Site Generation on Android with Termux

Next.js is a React framework that gives you building blocks to create web applications. First thing I did was go to github and create an empty project. I then cloned that project in Termux. You must use the Termux storage and not shared storage unless you can find a workaround for creating symlinks. I then create a starter next.js project. npx create-next-app --example hello-world blog-posts I used python to extract all my blog posts titles and links from my Blogger backup and create a json file. Each entry in the json file was title and link. Next. I followed this guide to display a listing of all my blog posts. https://vercel.com/guides/loading-static-file-nextjs-api-route It uses SWR and SWR is an acronym for stale-while-revalidate. The code I got from there had some problems. Dont know why it worked for them and not for me. Maybe linux/termux/android/next.js version creates the issue. After debugging and consulting ChatGPT we figured out that: The issue with the code you provided i

Trinidad and Tobago Developer Hub Thoughts

I like the direction this is heading. I like the idea of it. I think that it can be innovative. I think once they react positively and actively to the feedback they get, this will be a success. I am cheering for this to be a success. I saw that it was launched today on their social media. They did not say what the url was but I made a guess and it was there - dhub.mdt.gov.tt I had watched Delving Deeper on TTT where they talked about the Developer Hub. One of the questions was about challenges. I think one (a big one) of the challenges would come from the selection of ideas/solutions. Some people might feel cheated that their ideas/solutions are not being selected. The Ministry might be accused of bias and favoritism and cronyism. I think what might help with this is that a component of the choosing of ideas/solutions has to come from public voting and scoring and also from other developers rather than solely from a few persons in the Ministry. The Ministry has to be open with scoring,

Choosing local software developers and software companies in Trinidad and Tobago

Their is a perspective that companies in Trinidad prefer foreign for software developers and software development services. I came up with some pointers on how I think we can change this and I asked ChatGPT to expand on these. 1. Encouraging a tech startup culture : Fostering a tech startup culture involves creating an environment that supports and nurtures entrepreneurial ventures. This can be done through initiatives such as organizing startup competitions, hackathons, and incubator/accelerator programs. Providing resources, mentorship, and access to funding can help aspiring entrepreneurs turn their ideas into successful businesses. 2. Involving the Ministry of Digital Transformation (MDT) : Engaging the MDT can be beneficial in several ways. They can collaborate with industry stakeholders to develop policies and regulations that promote local tech talent and businesses. The MDT can also support initiatives aimed at enhancing digital literacy, skill development, and technology adopt

My suggestions for the Developers Hub in Trinidad and Tobago

ChatGPT does a good job of explaining things. I asked chatty to take my ideas that I submitted to the Ministry and expand on them. This was the result. 1. Yearly Developer Survey : Conducting a yearly developer survey can provide valuable insights into the needs, challenges, and preferences of developers in your country. The survey can cover topics such as programming languages, frameworks, tools, and emerging technologies. The results can help shape the direction of the developer hub, identify areas for improvement, and guide the allocation of resources. 2. Hackathons : Organizing hackathons is a great way to foster creativity, collaboration, and innovation among developers. These events can be themed around specific technologies or problem domains, and provide a platform for developers to showcase their skills, work on real-world challenges, and potentially even launch new projects or startups. Hackathons can also facilitate networking and knowledge sharing among participants. 3. Sup

Using Pagefind with 11ty in Termux

Also see previous blog post on how I got started with eleventy on Termux https://trinbagotechie.blogspot.com/2023/06/an-example-of-getting-started-with-11ty.html The Pagefind npm package is just a wrapper for their binary. It does not work on Termux. What I had to do was build from source using cargo install pagefind The documentation for Pagefind is pretty useful and I started here https://pagefind.app/docs/ I got the following error when building with cargo error occurred: Failed to find tool. Is 'aarch64-linux-android-ar' installed? I found out that I had to install binutils pkg install binutils As it instructs you, make sure and add the bin folder to path so that you can run the pagefind command export PATH=/data/data/com.termux/files/home/.cargo/bin:$PATH The two things I needed was data-pagefind-body and data-pagefind-ignore because I only wanted the poem content to be indexed and because I deploy to github pages I had to specify baseUrl The pagefind command that I used w

An example of getting started with 11ty in Termux

The first thing I did was watch some youtubes on static site generators and then I decided on one. I chose 11ty because it popular now and it is highly configurable with minimal opinions. I followed the instructuons from the Getting started guide https://www.11ty.dev/docs/getting-started/ You must use the Termux builtin storage and not shared Android storage because 11ty node install uses symlinks. Let me know if there is a way to circumvent this. It would be nice to use my android editor apps instead of vim. I removed index.html I removed README.md Created this file structure https://github.com/hassan-theitguy/poems/tree/main/poems I used python to create my poems.json file from a poem.dat file that was exported from Google Keep and @ prefixed to each title Make sure the field used for pagination is unique. I had 3 duplicates that I manually fixed but I will change my python code to include index in the json. The two main things I learnt was creating pagination in nunjucks and looping