Open in app

Sign In

Write

Sign In

Paulund
Paulund

23 Followers

Home

About

Feb 25

Write Better Functions

As a software developer, writing good functions is an essential part of creating maintainable and reliable code. In this blog post, we’ll look at several tips for writing better functions. Make your functions small and focused One of the keys to writing good functions is to keep them small and focused. Smaller functions are easier to…

PHP

7 min read

PHP

7 min read


Jan 12

SOLID Principles

SOLID is a set of principles that can help you design and write better object-oriented code. These principles were first introduced by Robert C. Martin, also known as “Uncle Bob”. The SOLID principles are: Single Responsibility Principle (SRP) Open-Closed Principle (OCP) Liskov Substitution Principle (LSP) Interface Segregation Principle (ISP) Dependency…

Development

6 min read

Development

6 min read


Jan 3

Uncommon HTML Attributes

There are many additional features that come with HTML5 such as the HTML5 attribute placeholder and required. In this article, we will look at some of the new HTML5 attributes and how they can be used. Hidden Attribute The hidden attribute can be used on any element it hides the element which…

HTML

3 min read

HTML

3 min read


Jan 1

JavaScript Helper Functions

Capitalize First Letter Of String This is take the first letter of the string and uppercase the letter. Then it will concatenate the rest of the string without the first letter. const capitalize = (text) => `${text.charAt(0).toUpperCase()}${text.slice(1)}`; ucfirst function Camel Case A String You can do this by using the below regex to select all the matched parts of…

JavaScript

6 min read

JavaScript

6 min read


Dec 26, 2022

Test Helper Function

If you work on multiple different PHP projects, some might use different testing frameworks the most common at the moment is PHPUnit and Pest. But what if you want to use the same test helper function in both projects? You can use the following script function to make sure you only have to type the same function on every project. function test() { if [ -f ./vendor/bin/pest ]; then ./vendor/bin/pest $1 elif [ -f ./vendor/bin/phpunit ]; then ./vendor/bin/phpunit $1 else echo "No test framework found, add phpunit or pest to your composer.json" fi }

Development

1 min read

Test Helper Function
Test Helper Function
Development

1 min read


Dec 26, 2022

Docker ARM64 Images on M1 Macs

I recently upgraded to a new Macbook pro m1 and when running docker I was getting the following error: ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries This happened when running a mysql image, I needed to define the platform to be linux/amd64. Within the docker-compose.yml file I added the following: services: db: platform: linux/x86_64 image: mysql:5.7 This resolved the issue for the time being. If you’re not using docker compose you can add the --platform linux/amd64 flag to the docker run command.

Docker

1 min read

Docker ARM64 Images on M1 Macs
Docker ARM64 Images on M1 Macs
Docker

1 min read


Nov 7, 2022

Design Patterns — Singleton

Singleton is a design pattern that lets you ensure that a class only has one instance, while also allowing you to have global access to the single object. The problem this solves is to ensure that there is only ever one object of this class, why would you want this? …

Development

2 min read

Development

2 min read


Oct 1, 2022

Add Cache Control To Nuxt3

HTTP caching allows you to store a response to a request allowing your browser to reuse stored responses for subsequent requests. This gives you the advantage of not having to refetch content from the origin server allowing your visitors to have faster response times. You can quickly do this in…

Nuxtjs

1 min read

Nuxtjs

1 min read


Oct 1, 2022

Camelcase String With JavaScript

In this tutorial we’re going to change a string of words to be camel-cased. You can do this by using the below regex to select all the matched parts of the string and then on the first index you lowercase the word and on the next indexes you can make uppercase. export const camel = (text: string): string => { return text.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function(match, index) { if (+match === 0) return ""; // if space return index === 0 ? match.toLowerCase() : match.toUpperCase(); }); }

JavaScript

1 min read

JavaScript

1 min read


Sep 24, 2022

Get Unique Values From Array In JavaScript

In this tutorial, you will learn how to get the unique values from inside an array in JavaScript. There are a few ways this can be done some of the most common ways are to use JavaScript array functions such as map and filter. …

JavaScript

1 min read

JavaScript

1 min read

Paulund

Paulund

23 Followers

Software Developer

Following
  • Smashing Magazine

    Smashing Magazine

  • Madza

    Madza

  • php.net

    php.net

  • David Walsh

    David Walsh

See all (16)

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech

Teams