DEV Community

loading...
Ben Sinclair profile picture

Ben Sinclair

I've been a professional C, Perl, PHP and Python developer. I'm an ex-sysadmin. Back in the day, I had a geekcode which I'm not going to share with you. 418 I'm a teapot.

Location Scotland Joined Joined on  Personal website https://moopet.net github website twitter website

Education

Something something cybernetics

Last 250 comments

Protecting audio and music assets with Node and Javascript

Part of the point of services like Bandcamp is that their mus...

Linux Cheat Sheet For Beginners

Your "User management commands" descriptions are all wrong - ...

Happy (Not Really?) Pi Day!

I appreciate the effort that went into this but clearly dates...

Learning to love Tailwind CSS

The problem is, that if you run a takeover on your site - for...

Learning to love Tailwind CSS

With component-based solutions, you lose the ability to make ...

I'm switching to vim!

That's only for neovim, though. Other plugins like vim-fzf wi...

Why I'm Not One of the Guys

I haven't read all the comments, but in case it hasn't been m...

Why I'm Not One of the Guys

Do you not find it interesting and amazing that people use l...

Why I'm Not One of the Guys

"Guys" is sometimes colloquially used in a gender-neutral way...

Why I'm Not One of the Guys

I'm aware of how it's sometimes used, but it's all about sets...

Why I'm Not One of the Guys

"Guys" has been rubbing me up the wrong way for a long time n...

Why i hate Javascript

Sure you can! Just like you can define variables as const or...

Setup a new mac (for devs [and others]) 💻

There are shortcuts for "delete back a word" or "delete to en...

How to clear port 8080 in windows

The area circled in red shows the PID (process identifier ...

Setup a new mac (for devs [and others]) 💻

Change the key repeat and repeat delay Why do you do this?

Interactive Fuzzy Finding in Vim without Plugins

I use fzf as a plugin, but I also have a couple of shell scri...

Do you use built-in terminal or terminal emulator?

I use a separate terminal emulator because, well, I do most t...

Using isset() and empty() hurts your code

I've been using PHP since version 3 and still have to look up...

Why Do Companies Ask For Passion?

Phrasing in things like job descriptions is actually my partn...

Do developers still use PHP?

Yes. The last two agencies I worked for have exclusively used...

Basic Bash Automation: A script to organize my downloads folder

This might be simpler as a function or a script held in your ...

Opensource... NO more free?!

If you want everyone to have access to your code, "everyone" ...

What was your win this week?

I applied classic debugging principles to my car, disconnecti...

I Wan To Buy a Coffee Machine. Do you have one ? Which do you recommend me?

A "machine", no. But I do have a Bialetti moka pot I use on t...

Is Dev.to victim of its own success?

I agree that we shouldn't try to "raise the bar". When people...

Is Dev.to victim of its own success?

This is all a bit of a grey area.

Is Dev.to victim of its own success?

Someone's probably written a VS Code extension to highlight t...

💡 Quick Tips: Make your DEV.TO home feed better with "Anti-follow" Tag Weightings

I knew - ish. Last I'd heard, you couldn't set a negative val...

Permission Issues on MacOS with Git

What would cause your local .config directory to be owned by ...

Hi i am new in dev and i want 100 followers guys help me.

What do you want 100 followers for?

[DELETE] - The solution!

I haven't followed those links because they're through Linked...

6 figure job in 6 months

I have a six-figure job. The first few figures are zeroes, bu...

How to count lines of code you written.

You shouldn't need to run anything with sudo for this kind of...

change directory command

We use ~ symbol to indicate that the path is relative. Tha...

Stop choosing DX over UX. Or maybe not?

I'm not sure I agree with your axioms. If I want something t...

Setting up Mac for Web Development

brew hasn't used the cask command for a while. It's brew inst...

Screen Real Estate

If you have to use a Mac, I can recommend rectangle (based on...

Bringing Back the 90s with the Wicked Coolkit

Who among us didn’t have beloved Pokémon, Digimon, Yu-Gi-Oh!...

How's your experience with Xcode? (I want to cry 😭)

I've only had to use it a couple of times, and never to actua...

macOS themed Portfolio website

Be careful - Apple have a history of taking legal action agai...

One-liner to sum up numbers from a CSV file

Using six commands demonstrates six commands, and how to chai...

Best Laptops for Software Development in 2021

As you say, it really depends what kind of development you're...

Should You Really be Coding in Dark Mode?

f.lux and its alternatives solve a different problem, and hav...

One-liner to sum up numbers from a CSV file

I like this, because there are loads of ways you could do it....

Code Smell 05 - Comment Abusers

Yeah, it looks right now.

I changed my master passwords (and thoughts)

Now you have two points of attack.

I changed my master passwords (and thoughts)

Cloud-based password managers generally support 2FA. If you'r...

Moving from HEY to Fastmail

I'm not entirely sure why people would choose Hey in the firs...

I changed my master passwords (and thoughts)

You're saying, use KeePass' password generator but store the ...

Code Smell 05 - Comment Abusers

I can't see any difference between your "wrong" and "right" e...

Find and Replace a Bunch

Note that sed you're using is BSD-style. On GNU, it'll still ...

Turn your Manjaro into Arch

Yes, pretty much. There are still some odd references to Manj...

How to Dynamically Update Twitter Cover Image to Show Latest Followers Using PHP GD and TwitterOAuth

For me, I might as well make it a static image :)

Unsubscribe to confirm email

I'm pretty sure people have been warning about this for 20 ye...

Things I wish I knew about… JavaScript functions

Apart from anything it saves coming up with lots of differen...

Don't Develop Just for Yourself - A Developer's Checklist to Accessibility

The hint for checking your site (if it's a website you're mak...

How To Make Side Income As a Web Developer in 2021?💸

Yes, but I'm sure there are also many developers who are good...

Vim Tips and Tricks

Now that you’re in insert mode, you can type “:” and then an...

Sublime Text 4 is here, can it convert you? (Snack Pack #6)

What do you think about the new version of Sublime Text? Is ...

How I Make an Average of 250$ Every Month on Twitter

posts tend to go viral when you post a really good tweet or ...

Back to basics: Why excellent markup is the foundation of accessible content

I see DIVs and SPANs as code smells.

🐧 Why I switched back from Windows to Linux (Arch/Manjaro)

The RebornOS website litereally doesn't say what it is. After...

Turn your Manjaro into Arch

I'm going to follow it and see what happens. I have a manjaro...

DEV.to internal search is... bad?

I've put in a bug report for this already here: forem/issues/...

Hatay Hava Durumu

I'm not sure why you're linking to a weather site, but on the...

No Need, but some use semi-colon in Python. Here's Why!

You can do that, but Sparse is better than dense. Readabil...

Issue with Else If Statement

if the sum of 2 digits is above 10, but less than or equal t...

Issue with Else If Statement

Let's cut it down a bit. This bit here is redundant: if ...

make sudo not ask for password

"make sudo not ask for password" is the post title, and that'...

A simple parameter validator

[ 'name' => 'required|min_len:5,max_len:10', // requ...

Issue with Else If Statement

I simply do not understand why this works. Try it out in y...

make sudo not ask for password

That's not making sudo not ask for a password, it's logging i...

How we got rid of cookie consent banners and why

The solution was simple: Just get rid of cookies. For tho...

TailwindCSS: Adds complexity, does nothing.

Who said anything about Bootstrap? I did, me. What I'm sa...

You have never seen this product card before

I don't know what that's supposed to do (I didn't watch the v...

7 rare website with awesome free fonts

Why do you describe these websites as "rare"?

Why Regular Expressions Are Super Powerful, But A Terrible Coding Decision

If that's the case, then nothing helps!

Why Regular Expressions Are Super Powerful, But A Terrible Coding Decision

Anything that's parsable data should be parsed with a parser....

Mid-Life Coding Newbie

Exactly. This year I'll turn 30 ... in hexadecimal.

How to Detect Symbols & spaces With RegEx!

use .match() in Javascript to search for the symbols. Nitp...

Censorship on DEV Community 😶🤐

The example Andrew kindly provided wasn't caused by anything ...

Should I use ternary or the logical and operator?

I'm a fan of making things as easy to read as possible. In a...

Easy Tailwind CSS Trick to Create Responsive Websites in 1 Minute

img { max-width: 100%; } Enter fullscreen mode ...

Censorship on DEV Community 😶🤐

No, no I'm not assuming you mean the same thing! I'm saying ...

Censorship on DEV Community 😶🤐

It's what's generally meant when people complain about free s...

Do I need to do private side projects to be/become a professional web developer?

Do you need to? Absolutely not. In fact, I think people put ...

OhSnap! Handy Terminal & Git Commands

Gotcha. If you're using Vim to edit git commit messages and ...

Censorship on DEV Community 😶🤐

Gotcha.

Censorship on DEV Community 😶🤐

despite the possibly misleading title of my post [...] I t...

Censorship on DEV Community 😶🤐

I have only been notified of one comment of mine being delete...

Censorship on DEV Community 😶🤐

I'd be very much against displaying any sort of stats like th...

Censorship on DEV Community 😶🤐

I have no idea what post "we" might be talking about here, fo...

Censorship on DEV Community 😶🤐

When you say you've seen this happen more recently, do you me...

TailwindCSS: Adds complexity, does nothing.

And it is on the author to cover both sides I don't think ...

TailwindCSS: Adds complexity, does nothing.

I don't think making money is a useful metric for anything el...

OhSnap! Handy Terminal & Git Commands

Couple of tips: cmd + k is going to be specific to MacOS. ct...

TailwindCSS: Adds complexity, does nothing.

I'm not sure I follow. I'm saying that having the same featur...

Why Tailwind? A long term user perspective

Bloating the HTML by eliminating the separation of concerns ...

TailwindCSS: Adds complexity, does nothing.

Ever use a modifier class to change how your component appea...

TailwindCSS: Adds complexity, does nothing.

You can do that in things like Sass, too. It's not a benefit ...

20 JavaScript One-Liners That Will Help You Code Like a Pro

09 Toggle boolean const toggleBool = (bool) => (bool ...

Choosing semantic HTML mark-up for italic text, guided by Chicago Manual of Style

This is very interesting. I've never taken a step back to thi...

Do you use subdomains?

Yes, yes I do. An example is the.littlest.website which, to ...

15 reasons why you should be using Figma for design

It is Free Kinda. It has a freeware tier, but it's prop...

A Rose by any Other Name

toggle CHANGES the name of the class ("firstColor") to anoth...

Have you ever seen foldable login form ?

I can appreciate the effort that went into this, but why woul...

Brave - The Browser that pays Crypto

Either an ad is displayed when you open a new tab. Which you...

8 Linux Commands Everyone Should Know

I wrote an entire post about that once :)

How I Use Vim to Code (Productivity Tips)

I'm a big fan of Vim and someone who doesn't "get" why Sublim...

Is 0kb of JavaScript in your Future?

the ability to server render a page and then have forms func...

An Enhanced Shell With ZSH

Most of the things people claim you can do with zsh are scrip...

Undo your last git mistake with ugit

Yo bhupesh, I can just you know alias this command. That ...

✔||🤢 Commit or Vomit | function currying 🍛

I don't really like currying, but that might be because I've ...

8 flags showing it's time to quit my job as a developer

Leaving a company simply isn't an option for a lot of people.

Rejected by Facebook

Mm, "I am not able to" can mean that they usually do if they ...

How I exploited NPM downloads... and why you shouldn't trust them

That's not what the post is getting at (to my reading). The e...

~/.dotfiles

This is a very nice write-up.

Supercharging Vim: Navigate files instantly

I use fzf, these days. I always found CtrlP was reeeeeeaaaaaa...

Using the glassmorphism UI trend in your web project

You should be careful using this sort of technique that the t...

How to get 4000+ followers on Spotify

Why do you want your playlists to have lots of followers? Is ...

Tricks of declaring dynamic variables in Bash

Given the format you've chosen for storing variables is the s...

Different Markdown Editors, And Why I Use Ulysses

I might be in the minority here but I like reading markdown a...

Tes

Succes

Say something from the terminal

The most amusing thing about say is that if you ssh into a ma...

Would you use a webapp to search linux commands

Commands with long paths don't matter. You make sure they're ...

Would you use a webapp to search linux commands

man -k or apropros help with that. But fundamentally, if you...

Would you use a webapp to search linux commands

How do you remember the options and flags supported by a spe...

Question: How many of you google basic things for your language after several years of experience?

I'm (mostly) a PHP developer these days. I've been doing it o...

Page scroll progress bars

Gotcha :)

Page scroll progress bars

The home page here breaks browser functionality, but it's not...

Page scroll progress bars

But what if the site didn't hide the native scroll bar? Would...

Page scroll progress bars

Infinite scroll breaks browser scrollbar functionality, and t...

Page scroll progress bars

That sounds like a web browser but with extra steps :)

Page scroll progress bars

Unless you have an unusually large footer, why would the two ...

Page scroll progress bars

So there's some kind of a progress bar that tells you how mu...

DISCUSS: JavaScript just DIED! What language should replace it?

PHP is a dinosaur in the tech space! Does that matter? The...

DISCUSS: JavaScript just DIED! What language should replace it?

At the moment, based on the agency I currently work for, I'd ...

Are we all going to have tabs for smartphones?

We all agree our smartphones are at the center of our daily ...

Put Down the Destructuring Hammer

This isn't a straw man - the title of the post is "put down t...

DEV.TO writers, what MD tools do you use?

Vim. Sorry not sorry. The whole point of Markdown is that y...

ZSH cheatsheet for git plugin

You're talking about plugins for oh-my-zsh, right, not for zs...

TailwindCSS: Adds complexity, does nothing.

I agree with all of this, and have been mulling over making a...

Command-Line Interfaces: Structure & Syntax

This is really cool. I don't think I've ever thought about ex...

Why “dark mode” is more energy-efficient: How to calculate image energy-cost

That research is a decade old now - transfer costs have presu...

Why “dark mode” is more energy-efficient: How to calculate image energy-cost

Aren't OLED screens in the tiny minority, though, overall?

Creating an SSH connection to a server

Top tip: pbcopy is a MacOS-specific. On systems with X, you c...

TOP 30 Mac Useful Tools

I'll second the recommendation for Amphetamine. I use it to s...

🔨 [git]: Write better commits with Gitmoji

I think this is a lot harder to read than text, and a lot har...

Are you using these Code Editors?

You already said that, in the post and the video, and I think...

Towards a better message of the day

Wait what I wrote this forever ago and didn't even notice I w...

Why I moved from Styled Components to (S)CSS modules

I mean it in "why not go back to regular CSS" terms. Unfort...

Why I moved from Styled Components to (S)CSS modules

It also cost readability. It's ok if you end up writing simpl...

YouTua - Download any Videos Instantly...

If you're happy with command-line tools, youtube-dl does this...

Current time tag

I'm not sure what you're asking?

Still Using HTML? Start Using React Components

But when you use React components, you're still using HTML...

What password manager should developers use ?

It's not really greedy when it's a service and product they'r...

What password manager should developers use ?

More importantly, and something I forgot to mention, is that ...

Show off the swag you got (̿▀̿‿ ̿▀̿ ̿)

We can all agree on one thing that swags are awesome. Allo...

MegExp?

Are you saying this is something that exists, and you want op...

Are Code Editor Extensions Hurting Young Devs?

I would say it's something that affects developers early in t...

A simple strategy for structuring TailwindCSS classnames

I[f] you want to take it even further, you could outsource y...

Warning: Elaborate Scams Abound!

Always hang up and call the official support number. This....

Easily Manage Dot Files (Config Files)

Why do you use sudo for every copy command? The implication i...

Migrating from Lastpass to Bitwarden. I'm changing password manager 🙅

I moved to Bitwarden after someone mentioned it on a post her...

Can’t work or code continuously because of slow laptop or PC? Try these steps

the limitation of going outside There's a much greater ava...

MVC Tutorials Are Broken

In particular, they had a 3,000 line “method” for their sear...

Bringing Modern OO To Perl

I looked at some Perl I wrote the other day, from about 15 ye...

A Tiny Note About Interfaces

Exposing the scaffolding is making an implicit promise that ...

Dreams about coding solutions?

I sometimes dream solutions. Sometimes they even work. Someti...

PHP 8 Is here! A step in the right direction?

I think in many ways PHP is a lost cause. It simply has too m...

Why start using TailwindCss in 2021

That's not how people use it; people do it the Bad Way in the...

Why start using TailwindCss in 2021

Why bother learning this new way of writing CSS? It's an o...

Writing better conditional expressions in JavaScript

Sometimes it does, sometimes it doesn't; I don't think you ca...

Ever thought of random numbers in CSS?

Can you think of an example of when it would be useful?

How do you like my resume?

I think it looks like a young person's work. No offense! What...

How do you like my resume?

Why not? Ideally, any page you read in a browser should work ...

How do you like my resume?

Every website I make will fit in any device from a large com...

Lensflare - The next Unsplash. Please offer some feedback on it!

Looks good! Found a few issues: Scrolling is broken for me ...

Go Update Your GitHub.... NOW!!

What if you choose to use something other than Github? Are yo...

Best Way to take Backup of Gmail Emails

Or you can choose to download your email directly from the Gm...

Coding is Boring! why do you love coding?

It's a bit like a game. Like Minecraft, for example. You can...

HERN Stack, Comin’ In Hot

I don't even know how I would begin to pronounce HFRN Gett...

You Had Me At Node.js

... unique advantage because millions of frontend developers...

What password manager should developers use ?

They are though. They exist because people are prepared to pa...

What password manager should developers use ?

Ok, without getting too reductionist, I don't particularly un...

What password manager should developers use ?

A computer is a hardware solution.

What password manager should developers use ?

1password started as Mac-only so when I used the 1password in...

How I cleared Naggaro IQ test [50Qs -12mins -18 reqd' to clear]

I don't think that's how statistics works. Assuming the distr...

How much money have you made with DEV posts?

28 Free Udemy Courses: Python and More

All your links look like they go through LinkSynergy which is...

What password manager should developers use ?

When you join a company you probably have to use whatever the...

HOW TO MAKE A SIMPLE BLACKJACK GAME IN PYTHON.

Hi! You may want to change your post title, because at the m...

What’s a website site if nobody can discover it?

What if you own your Mercedes Benz because you... like it?

Refactoring IF, a real exercise

Refactoring isn't about improving performance. I suspect that...

Writing better conditional expressions in JavaScript

I find short circuits, destructuring and arrow functions seri...

✔||🤢 Commit or Vomit | Easter eggs

Whether I would or wouldn't depends entirely on the product a...

Why do you still use Sublime?

That's not a point in favour of ST though unless what you're ...

Vim Thinking

I'm pretty sure people would cut and paste (or retype) the 0 ...

Light mode or dark mode: Which do you prefer and why? 🤔

I think that we've had themes for decades, and things like f....

Why do you still use Sublime?

I just started VSCode on my Windows gaming machine (while wri...

Why do you still use Sublime?

What about WinAmp?

Why do you still use Sublime?

Most editors support plugins, don't they? I know Vim will let...

Why do you still use Sublime?

It is smaller, faster Than what? Other editors in general ...

Light mode or dark mode: Which do you prefer and why? 🤔

I prefer people to write their software to respect the user's...

If (all) else is complicated, switch to switch?

Generally I think people are trying to move away from functio...

If (all) else is complicated, switch to switch?

Because anyone who isn't used to seeing it will think it's a ...

How I cleared Naggaro IQ test [50Qs -12mins -18 reqd' to clear]

if you keep only One choice of option probability of getting...

Static Site Generators - the WordPress alternative no one's talking about

A static site generator is literally a site like wordpress bu...

Surfing web inside a terminal, because why not?

I got through about half this post thinking, "why not just us...

Integrating Tinkerwell with GNOME

What problem does this solve? PHP already has a REPL, and mos...

Is JQuery still worth learning in 2021?

It doesn't matter so much that there's a lot out there. It's ...

How to access localhost from the Internet?

They're all free unless you want to do "advanced" things with...

Quick Test Your Bash Shell

If you run it via bash or make it executable and run it, it'l...

New laptop, new OS. My adventure going Linux starts here.

Apple lets you pick whatever keyboard layout you want It d...

An Algorithm to Swap Two Variables Synchronously, Without Creating a Temporary Variable

I can't imagine this being useful even at an enormous scale u...

How I Made This Realistic Red Switch (Pure CSS)

Nobody says that though, they say "Pure CSS". It's kind of a ...

Your website does not need cookies

Also, I got 52 seconds on that game, which is a totally cool ...

Your website does not need cookies

Getting clients on board is next to impossible. They want th...

How I Made This Realistic Red Switch (Pure CSS)

I know what you're getting at. But pure CSS to me means using...

How I Made This Realistic Red Switch (Pure CSS)

It needs a bunch of HTML to back it up? There are several DIV...

Introduction To The Command-Line Interface

Your "tidy up" section implies you're missing a step. You cre...

How I Made This Realistic Red Switch (Pure CSS)

This looks really nice (though it's not "pure CSS"). If I co...

How I Made an Inaccessible Site Accessible for Myself with UserCSS

I've used a few community style extensions. I find they're of...

What if LinkedIn was beautiful? - New UI

I think the existing LinkedIn interface looks kinda nasty, to...

Wondering about browser cookies? this post for you!

Actually, we deal with browser cookies (sometimes without kn...

What Does a Personal Injury Lawyer Do?

From what I've been able to tell so far, what a personal inju...

Why your website should work without JavaScript.

Re your accessibility point, Some people find it easier to...

Organise your forms with fieldset

You know, it never occurred to me that you could disable enti...

Getting started with GPG(GnuPG)

How did you get your code blocks to have the little "full scr...

Regex - underrated or overHATED? Part 1/ 3

That first, "random" example you gave is a poor one because i...

Should Developers Join Clubhouse?

Clubhouse has been all the rage lately online I've never h...

How to get current date time in vue js

Wouldn't this be... new Date() ?

Emoji😊🤣 In Python

So Why not start using emoji in our python program Oh go o...

So, how many of you respect CSS as a programming language?

I'm not sure what you're getting at. You've very deliberatel...

Cool json git diff command

That's clever.

Do you use Linux? Answer for the chance to appear on the DevDiscuss podcast!

I use Linux, on my personal laptop, on my gaming PC under WSL...

Zsh Tricks to Blow your Mind

I use zsh these days because it comes on my work Macbook, and...

Don't fear the command line : Tar. What is that?

The f needs to be the last flag in a group because it require...

How to use fancy font anywhere

What do you mean by "it works on searching"? On this page, i...

How to use fancy font anywhere

How does this work with plain text, searching, or screen read...

Web Development on a 13″ MacBook Pro M1

Yeah, I use mine with external everything too :)

Web Development on a 13″ MacBook Pro M1

The giant touchpad on my 2020 model does the thing where when...

Write good PHP - Lookup-arrays

You've made the switch version look more verbose by changing ...

Write good PHP - Lookup-arrays

I'd never heard of it. It looks better than switch for most t...

Accessibility Audits

These tools are a good place to start, but you need to get re...

test2

Dasfasda.

loading...