In last Friday's Dev Digest, we had some great AI news, some worrying security threats and a swipe-aware game in CSS with explanations!
News and Articles
Let's kick off with some AI news. Netflix caused a stir with AI-generated images in a true crime documentary. Anthropic released a cookbook for building with Claude. OpenAI introduced up to 50% discount for asynchronous tasks with the new Batch API, the Washington Post asked people and experts "What is AI" and got lots of different answers and Google also did research amongst developers. The first AI software engineer, Devin, has been exposed as not being all that, and here's a roundup of popular Open Source AI tools for developers.
In security matters, the open source world is worried about more xz-style attacks coming soon and the OpenJS Foundation had a project takeover attempt to deal with. The DDoS threat report for 2024 Q1 shows a huge increase of attacks aimed at Sweden after joining NATO. Talking of odd things: JavaScript execution in PDFs is not a security bug and cats can be DDoS Attack warning systems.
And in a food for thought section, Jim Nielsen has an interesting piece explaining that faster connectivity does not equal faster websites or - in other words - it is not our user's job to make our products easier to consume.
Weird code things…
The developer tools console is the #1 debugging tool of web developers. And yet, most people only use a very small part of its methods. You can measure, trace, monitor, group messages and many other things. One neat method is console.table() which allows you to display tabular data and filter it. If you want that in Node, you can use voici.js and if you want to see console messages without opening the Developer Tools (or undocking them) you can use screenlog.js.
Code and Tools
CODE100 will be in Manchester on the 22nd of May as part of DTX Manchester! We are looking for participants and challengers. Head on over to the official CODE100 web site to learn all about it.
And if you have an idea for a challenge, you can tell us about it and win tickets for the WeAreDevelopers World Congress!
CODE100 puzzle: Unknown pleasures
To celebrate CODE100 coming to Manchester, here is our take on the classic Unknown Pleasures by Joy Division cover. In this challenge we asked you to return the amount of black or transparent pixels in the image and return it as an integer. The solution is pretty straightforward:
The JSON object is a HTML5 canvas representation of the pixels. This ImageData has its own format: You get the width, the height of the image and the pixels in RGBA. Knowing this, the solution to finding the transparent/black pixels is a simple loop and comparison.
In JavaScript, this could be:
Canvas and pixel manipulation is so much fun.
Tools and Code articles
Here are the tools and code bits for this week. Let's start with tools:
- Madge generates a visual graph of your module dependencies so you know where you pull in is-number.
- MarkdownDown converts any website to markdown, including images
- Reader converts any URL to an LLM-friendly input with a simple prefix
- You can OCR PDFs and images directly in your browser using TensorFlow
- Codemate search is a search engine for developers
In JavaScript, we have:
- It's not that straight forward to access the last JavaScript array element.
- Set Methods for JavaScript are coming and sound very Venn-diagrammy…
- A proposal to add a method to sum multiple values to JavaScript
How about some CSS?
- Every CSS Animation property in one video
- What if you had control over Light Mode / Dark Mode on a per-site basis?
- light-dark() makes changing styles depending on setting a one-liner.
And to Git things done:
Work and Jobs
The work world wonders who wins the AI talent wars whilst Sam Altman explains why OpenAI might steamroll your AI startup. Enough faux(?) drama to makes us think about the importance of mental Health in Software Engineering and the joy of building something real in your spare time that you control. There is an interesting infographic on software developer salaries around the world and let's end this time with a focus on code reviews: what to say in code reviews, how to improve code reviews with storytelling, and the right mindset if you're the author.
Procrastination Corner / Wonderful Weird Web
- Commodore 64 outperforms IBM's quantum system - I knew it!
- Desert Racer is the world's first swipe-aware CSS game and Curious Geckos is the most precise CSS-only Position-Aware one. Each come with detailed explanations how to build them!
- The Ballmer Peak researches the right amount of blood alcohol needed to reach peak developer efficiency. Remember, the Inebriati are watching.