Posts

Crafting Recursive Prompts with Plop

When scaffolding new projects or features, repetitive tasks like file creation and boilerplate code can waste valuable time. That’s where Plop comes in—a micro-generator framework that helps automate these monotonous processes. Today, we’re diving into the world of recursive prompts in Plop, which allows you to interactively collect data in a loop based on user input. What Are Recursive Prompts? Recursive prompts enable you to repeatedly ask the user a series of questions until a certain condition is met. This is particularly useful when the required inputs are not fixed, such as adding an unknown number of items to a list.

Build a polling request implementation with the Aurelia 2 Fetch Client

Sometimes you have a request that doesn’t immediately return a response. For example, the user uploads some audio files and you process those and return them. Using the Aurelia 2 Fetch Client, we are going to build an implementation that allows us to poll a specific endpoint and use callback functions to configure our response. import { HttpClient } from '@aurelia/fetch-client'; export interface PollingOptions { pollingIntervalMs?: number; maxPollingAttempts?: number; isSuccess?: (response: Response) => boolean; parse?: (response: Response) => Promise; } export class PollingHttpClient { private readonly httpClient: HttpClient; private readonly defaultPollingIntervalMs = 1000; private readonly defaultMaxPollingAttempts = 10; constructor() { this.httpClient = new HttpClient(); } async pollUntilSuccess( url: string, options?: RequestInit, pollingOptions?: PollingOptions ): Promise { const pollingIntervalMs = pollingOptions?.pollingIntervalMs ?? this.defaultPollingIntervalMs; const maxPollingAttempts = pollingOptions?.maxPollingAttempts ?? this.defaultMaxPollingAttempts; const isSuccess = pollingOptions?.isSuccess ?? ((response) => response.ok); const parse = pollingOptions?.parse ?? ((response) => response.json() as Promise); let attempts = 0; while (attempts < maxPollingAttempts) { try { const response = await this.httpClient.fetch(url, options); if (isSuccess(response)) { return await parse(response); } } catch (error) { console.error('Fetch error:', error); } attempts++; await new Promise(resolve => setTimeout(resolve, pollingIntervalMs)); } throw new Error(\`Polling failed after ${maxPollingAttempts} attempts.\`); } } To use it, simply instantiate it like you would the ordinary Fetch client:

Why Is Beef Jerky So Expensive?

Ah, beef jerky – the quintessential snack that’s both a road trip staple and a gourmet delight. Often found nestled between kale chips and protein bars, this meaty treat is a favourite for many. But why does this dehydrated delight often cost more than a decent steak at your local pub? The heart of any good beef jerky is, obviously, the beef. We’re not talking about any old cut here. Jerky calls for premium, lean cuts – think eye round or topside. These aren’t your budget meat cuts; they’re the kind that would make a fantastic Sunday roast. And as any savvy shopper at Woolies or Coles knows, higher quality equals a higher price tag.

ChatGPT: From Code Connoisseur to Bug Buffet – Where Did the Quality Go?

OpenAI, the AI alchemist who once charmed us with GPT-3’s witty prose and GPT-4’s early brilliance, has stumbled upon a potent new potion: the Elixir of Unreliability. ChatGPT, once a code-crunching, creativity-conjuring genie, has mutated into a buggy bottleneck, leaving users drowning in frustration and searching for the magic that’s gone missing. Remember those heady days in 2023 when GPT-4 burst onto the scene, weaving code tapestries and spinning tales that glittered like spun gold? Those were the days of true AI wizardry. Fast forward, and the lustre has gone duller than a tarnished trophy. Constant model tweaks, presumably in the name of alignment, have turned the once-dazzling diamond into a chipped piece of coal. Responses stumble in like a hungover party guest, riddled with errors and devoid of the spark that made GPT-4 so special.

Are Aussie Supermarkets Exploiting the Cost-of-Living Crisis? A Deeper Look

Australians grappling with the rising cost of living have a new target: supermarkets. Accusations of “record profits” and “price gouging” have intensified, prompting a closer look at the grocery giants and their role in the current economic landscape. Australia’s grocery aisles have become battlegrounds. On one side, shoppers grapple with rising prices, feeling squeezed by every trip to Coles or Woolworths. On the other side, the supermarket giants stand tall, reporting record profits and touting the benefits of their own-brand products, emblazoned with generic labels and promising lower prices. But is this private label push a win for wallets, or are we being subtly exploited in a game rigged for supermarket profit?

ChessUp Board Review: A Game Changer or Just Another Gimmick?

Chess is an age-old game that many cherish for its elegance, simplicity, and depth. In a time when technology is seeping into every aspect of life, the ChessUp board emerges, promising to elevate the game without losing its essence. But can it deliver? I am relatively new to chess. My eight-year-old son has been playing chess since he was four, and he was the one who taught me how to play funnily enough. He beats me quite often, and the gap has widened because he gets chess lessons at school. I wanted something with some smarts to help me improve at chess and improve my son’s game too.

A Hands-on Review of Google Bard Powered by Gemini

Google has finally unveiled its GPT-4 killer, sorta. Despite perceivably being at the forefront of AI, Google was blindsided when OpenAI released ChatGPT, its AI chat-based assistant. In response, Google rushed out v1 of Google Bard, which was terrible and unusable for almost any task you would give it. After declaring a ‘code red’ in December 2022, which saw co-founder Sergey Brin, who had stepped down from his executive role at the company in 2019, return to the office and help with its AI efforts, we are finally seeing the fruits of their labour.

Ozzi Mozzie Is a Scam: Don't Be Fooled

Recently, I came across a product advertisement on Facebook called Ozzi Mozzie. The ad caught my attention because we’ve been dealing with a significant mosquito problem recently due to rain, and it seems like targeted advertising is quite effective. On the surface, it seems like a great product. It starts off with the story of a farmer who allegedly woke up to find his young daughter’s eyes swollen shut and covered in bites from mosquitoes (17 bites, to be exact). He was inspired to find a solution to ensure it never happened again. Plausible, so I kept on watching.

AI Nuclear Winter Is Upon Us: Google Announces Gemini, Its Latest AI Model: Is This a Threat to OpenAI's Dominance?

With its recent update, Google is creating a stir in the language model landscape, which incorporates the latest model, Gemini, into Google Bard – specifically Gemini Pro. This newest version promises significant performance enhancements, prompting questions about its potential to challenge OpenAI’s supremacy in the field. Gemini Pro: Stepping Up to the Challenge While the Gemini Pro may not match the anticipated power of its successor, the Gemini Ultra, which is set for release in early 2024, still demonstrates impressive capabilities. Independent benchmarks show that it outperforms GPT-3.5 in several key areas, including:

Adding Custom Cron Schedules in WordPress

WordPress, by its very design, is a platform that offers a high degree of flexibility and customisation. One area that developers often need to customise is the scheduling of tasks within WordPress. The built-in cron system, WP-Cron, simulates a system cron by scheduling tasks at specific intervals. However, the default intervals may not always fit your needs. In this article, we’ll explore how to add custom cron schedules in WordPress, including additional times, such as every 15 minutes.