DEV Community

Vlastimil Pospichal profile picture

Vlastimil Pospichal

404 bio not found

Joined Joined on  github website

Last 250 comments

Make Your Tmux Status Bar 100% Better With Bash

~/.tmux/left_status.sh for file in /sys/class/net/*; do ...

What is JSON? And why do you need it?

JSON is a suitable format for communication with Javascript (...

Understanding REST api

(GET,POST,PUT,PATCH,DELETE) is not enough. You can use those ...

What's your commit strategy in personal projects?

Commit small, commit often. More commits for every feature. I...

Stop Using "data" as a Variable Name

It was a long and difficult journey before I came to this kno...

Stop Using "data" as a Variable Name

The words get, find, fetch, add, update, delete are not a pre...

How to write IMMUTABLE code and never get stuck debugging again

ORM does not use immutability and that is why there are such ...

Configure Git for Work and Personal stuff

Uhh, sorry. The path is .git/config. Each project can have i...

Configure Git for Work and Personal stuff

I use instead dev-work-a/.git/config dev-work-b/.git/config...

What editor, browser and terminal do you use?

Vim, Firefox, Bash with Screen.

MySQL or MongoDB? What to Choose for your Next Project?

Denormalized data are usable in SQL database too.

I don't use nil

I use NULL in databases because it's something different than...

SQL or NoSQL?

Trello runs on many servers, so MongoDB makes sense. However,...

SQL or NoSQL?

SQL.

Database Level CRUD Operations Using PDO

Instead of method openConnection(), I use a parameterized con...

What are your favorite less-common programming languages?

XSLT A very powerful, fast and at the same time underestimat...

The Benefits of TDD, Unit Testing, and Code Quality

The biggest benefit of TDD is that we create testable applica...

What OS do you use for development?

I use Ubuntu with Gnome. I solve some components in the cloud...

Why you don't need to remap the escape key in Vim !

Next: Try <Alt-d>d or <Alt-k>, <Alt-x>, etc.

Why you don't need to remap the escape key in Vim !

It's not that bad, I just use other abbreviations. Vim allows...

Why you don't need to remap the escape key in Vim !

<C-[> is impractical for me because I access [ via Alt-...

Make sense of PHP interfaces

I don't use Symfony, I am not limited by this choice. For th...

Make sense of PHP interfaces

Traits are a highway to hell.

Make sense of PHP interfaces

I don't like the suffix "Interface" in its name. Instead, I u...

Ditch VSCode for neovim

set noswapfile Why?

Deep dive into Python scopes

I never use global variables, I am happy.

ArrayList In Java.

List<Type> list = new ArrayList<>();

Reading Serialized PHP

Look into serialized object. This name is a class name, not a...

Reading Serialized PHP

object - O:strlen(class name):class name:object size:{s:lengt...

Returning an Array from a Bash Function

Array in Bash? Why?

The bane of every developer; spelling, casing, and random commas

const firstValue = process.argv[2].toLowerCase(); const secon...

VSCode vs Vim

In the Vim, the size of the project is not limited. He doesn...

Dotfiles - Git Config with Aliases

Yes, I know the global gitignore and I use it, but something ...

Dotfiles - Git Config with Aliases

git make change directory to root of the project first. I put...

Dotfiles - Git Config with Aliases

[alias] make = "! make" test = "! run_test" exclu...

Bash ~ never forget to git commit again 💥

I use git status in $PS1. Drop the `MSG=": No changes ". Thi...

The bane of every developer; spelling, casing, and random commas

Sorry, unfortunately I don't see a link to your GitHub. You u...

The bane of every developer; spelling, casing, and random commas

If you show your code, I'll show you how to improve it.

The bane of every developer; spelling, casing, and random commas

Your code is wrong. You deserve it.

Remembering the difference between GET and POST 💡

POST is for send data, GET is for receive data.

#002 - Clean Code - Names

Interface first, implementation last.

#002 - Clean Code - Names

It depends on what abilities will be required from the inject...

#002 - Clean Code - Names

No, in my opinion it's bad just the same. I use adjectives de...

#002 - Clean Code - Names

Hungarian notation is still alive: class Logger implements IL...

Deceptively simple search-and-replace across multiple files

:vimgrep '\<a whale\>' **/*.py :bufdo %s/a whale/a bowl...

11 Most Asked Questions About PHP

Original: stackoverflow.com/questions/tagged...

Don't repeat yourself principle ( DRY )

"Every piece of knowledge must have a single, unambiguous, au...

Linux - I am Love with Terminal

When logging in, I am not interested in the beginning of the ...

Linux - I am Love with Terminal

Unfortunately, this shortens the end of the file, which reduc...

Mastering rm command

I use rm -rf directory often, but never use rm -rf "$director...

Mastering rm command

This is new to me: rm -v !("filename") Thanx

No More postman just use cURL + vim = ❤

When you want change website, you need change all scripts. Wh...

Top 10 git commands everyone should know

Why :wqa! in Vim? :wq or ZZ is enought.

I don't understand why git should use ‘main’

This is what the racists came up with.

Java: Wrapper Class ⭐️

I don't use wrapper classes, because "weight" is not float or...

Display Git Branch Info In Bash Prompts

Incredibly! That's what hell looks like!

Git/Github Cheat Sheet

What is gh?

A Visual Guide to How to Actually Invert a Binary Tree

Sometimes you need invert the tree for 3rd party library.

A Visual Guide to How to Actually Invert a Binary Tree

function invertTree(head) { if (head) { var temp ...

Display Git Branch Info In Bash Prompts

What is problem with submodules? I prefer flat structure of ...

Morse code in Raspberry PI

I prefer this form of dictionary: letters = { "A" : ".-...

Display Git Branch Info In Bash Prompts

Can you have one Boost in a separate repository as a git subm...

Display Git Branch Info In Bash Prompts

I have some reservations about such practices, because a lot ...

Display Git Branch Info In Bash Prompts

That's too much. My own script in my repository (14k files) ...

Display Git Branch Info In Bash Prompts

Where is __git_ps1?

15 Command-Line Tools to Make You Better at Shell & CLI

I was not interested in this list of tools, but I respect it.

gitignore.io is great!

Each developer on a project can have a different IDE and it i...

gitignore.io is great!

I don't want to distribute a list of my private files and dir...

Input Validation: Client-side or Server-side?

Server side or combination of both.

How do you 'Save for later'?

I use trello.com

My top terminal commands

They are very useful for working with huge files.

My top terminal commands

vim - to edit anything sed - to filter and update awk - t...

SQL Injection!!!

addslashes don't prevent SQL injection. php.net/manual/en/fu...

Is "C Programming language" Still Worth Learning in 2021?

You need to define short functions and macros. The parenthese...

Is "C Programming language" Still Worth Learning in 2021?

Compare the number of parentheses in the Lisp application and...

Is "C Programming language" Still Worth Learning in 2021?

Lisp uses a garbage collector. It is also used at the hardwar...

Is "C Programming language" Still Worth Learning in 2021?

It's funny. First using i, then increment i, then use i as a ...

Is "C Programming language" Still Worth Learning in 2021?

The same goes for Lisp or Forth.

Is "C Programming language" Still Worth Learning in 2021?

This is one of the reasons I write prototypes and tests. I'll...

How do you backup your projects?

I use GitHub, GitLab and BitBucket for my projects. Google Dr...

What are Git Hooks?

pre-push from the video (modified): #!/bin/sh ref=$(git sy...

What are Git Hooks?

pre-commit #!/bin/sh # Make sure the email is set properly...

How do you keep notes?

Trello with 50+ boards.

Bash tip of the day: lazygit

Usually I don't want to select all files, especially if I wan...

Bash tip of the day: lazygit

I am not lazy. First I run git status to see what has been mo...

Bash tip of the day: lazygit

Why . at the end of git add?

Minimizing Keystrokes, Maximizing Productivity  -  Bash Scripting

Don't use git add ., use git add --all instead Try basename....

Git Explained: Tips and Tricks

s/alist/alias/

VSCode vs Vim

Vim for all cases. He works like I'm dictating commands to hi...

Red, Green and Refactor in TDD

codecademy.com/articles/tdd-red-gr... Test specify what you ...

How do YOU learn NoSQL (not MongoDB)?

What can't SQL do? What do you expect from NoSQL? What is you...

Stop setting the language of your website based on user location

What is object navigator?

Makefiles for automation and better dev-UI

$ cat parse_makefile.sh #!/bin/bash echo "Hello to the $1" p...

How to Keep Home Directory Clean?

I have some directories with >2k source files. No problem.

How to Keep Home Directory Clean?

81 No problem, 27 items are visible only.

Get, set... STOP!

Yes, I prefer activate and deactivate. It's no setting boolea...

Get, set... STOP!

I am a getter and a setter hater. I hate anemic domain model....

Makefiles for automation and better dev-UI

I use Makefile similarly, but for some actions I chose git al...

PHP For JavaScript Developers

Setters are unnecessary in PHP. Use immutable private attribu...

JS projects version and Our custom Git tools 😎😛💪

Why ignore the branch master?

Using the Fluent Interface Pattern to Create JavaScript Objects

Where is the behavior of the created object?

Why Not PHP?

PHP is a modern programming language.

URL Rewriting

Yes, when URL is example.com/post/12 , redirect it to index...

URL Rewriting

I don't rewrite URLs, just redirect to index.php

Is a Redis ORM a Horrible Idea?

There are three ways: Normalize database (break JSON and ...

Quick And Dirty Java Makefile

I have integrated Vim and Makefile. When I invoke make from...

Make a password manager with python: Making the basic mechanisms

It's too complicated. Use a database (eg SQLite) instead.

Productive Tools🚀 For Web Development😎

paletton.com/

How do you organize development projects on your computer?

I have main directories: Project gitlab prototype for d...

Melatonin Busting Glasses

Use blue background on your monitor.

5 Minutes Vim: CtrlP considered harmful

I always write a space after the comma. If a comma is follo...

Readable Code

Of course, broader the scope, the longer my names become. B...

5 Minutes Vim: CtrlP considered harmful

I use <space> for switch into insert mode. A comma is...

Let's progress together with the Linux Shell

PERCENTAGE=$(($INDEX * 100 / $TOTAL))

Automate typing with Vim macros

:let i=1|g/^#/s/$/\=' '.i|let i=i+1

Readable Code

I use namespaces for split words, Interactor\Controller\Vie...

Readable Code

What is "Thoughtful naming"? Short and simple or long and com...

Node vs PHP

No frameworks - some thin boilerplates only. PDO for databa...

Node vs PHP

Vanilla MVC.

Node vs PHP

I prefer PHP.

Node vs PHP

Yes, PHP is considered as a programming language. NodeJS to...

PHP Code Syntax highlighting (pretty printing) for CLI.

I use Vim syntax highlighter.

Bash Script Tool Kit

$ NAME="Jimmy McBride" $ echo $NAME Jimmy McBride $ ech...

gig: a gitignore generator

Global .gitignore curl -s "https://www.gitignore.io/api/v...

gig: a gitignore generator

This is not good for make .gitignore, but it is good for ma...

Do not write cheap code, make code cheap

Beware use public class Book extends BaseBook It soun...

Common casing types in programming

UpperCase with underscores

Common casing types in programming

Kebab-case is useful for Lisp, XML and XSLT for naming elem...

Execute command line commands from inside vim

:r !grep word file :r !sqlite3 data.sqlite "select value fr...

Read me first

Yes, I mean global variables.

Read me first

I don't like side effects configure_find_command() { if...

PHP seo_friendly_url Example For Slugger

Use tripple "`" for enclosure source code.

Three tools to help you become a better web developer

Git is perfect for private use too ESLint is for Javascrip...

Linux Checklist for Beginners

$ man woman No manual entry for woman

20 Intriguing, Unusual, and Goofy Programming Languages

Lisp doesn't belong here. Lisp is a regular programming lan...

Shell script that finds all files which correspond to a given template

ls dir1/*test* ls dir2/*fi*

PHP REPL - Interactive Editing Tool For Learning PHP (Hot Reload)

.vimconfig for PHP setlocal makeprg=php\ % map <F9>...

Gitignore Revisited

I put my own .gitignore into .git/info/exclude. It's good f...

Concept of the Day: Homoiconicity

S expression in Lisp may be program, input data, output dat...

What are your Favorite Text-Processing Tools?

XML and XSLT. CSV and AWK.

Bash: Rename specific files in a folder

Use command rename.

Is anyone else interested in #esolangs?

I like Waduzitdo.

What's Your Favorite PHP Test Automation Tools?

PHPUnit

Stop Using YAML

YAML is good for simple use, like Windows INI. It is good f...

4 levels of vim editor commands

Level 6 :)

SOLID PRINCIPLES: To start with Object-oriented programming

SRP: <?php declare(strict_types=1); class Book implem...

Git Branch + Commit Templates

Yes, but ... why? This is unnecesary duplicity.

Git Branch + Commit Templates

Why is branch_name part of the convention?

Vim quickies/ cheatsheet

de is good for delete word from cursor to end. It is good f...

How to stop naming Java classes with the "Manager" suffix

They are a bunch of functions.

How to stop naming Java classes with the "Manager" suffix

Manager is one of many empty and useless words that should ...

A php abuse

What is wrong?

SOLID Programming (Part 1): Single Responsibility Principle

This code is not DRY. content.split() is repeated and make th...

How to exit Vim

Ctrl-Z ... shell commands fg

Why static typing matters

I don't use IDE -> I don't need static types.

Whats your favorite programming language?

Extensible Stylesheet Language Transformations. Language fo...

Whats your favorite programming language?

PHP and XSLT.

Writing Good Unit Tests: A Step By Step Tutorial

OK, thanks.

Writing Good Unit Tests: A Step By Step Tutorial

Why is longitude and latitude splitted into two variables? ...

Free learning resources for programmers

Where is PHP?

Setting private properties in tests

How do you get the property name? It is private and may cha...

How to write Unmaintainable Code

Names i and j are good for local integer indexes. I use sho...

Setting private properties in tests

Use mocks instead.

How to write Unmaintainable Code

What is a comment?

Let's write HTML like a pro 😎

github.com/mattn/emmet-vim

What are the differences between production code and test code?

The difference is in purposes. Production code is for fulfi...

"Damn! Now I have to use Vim"

I use Vim for all projects, including compiling and running...

Differences between "null" and "undefined" keywords?

anna = {} bill = {} anna.age = null bill.age = null consol...

What is a Unit in unit testing

You must isolate dependencies. When test failed, where is ...

What is a Unit in unit testing

All No

Why does two small for-loops run faster than a big one ?

BigInt is slower.

Which unproductive activities are typically mistaken for productivity?

Use phone, use notifications.

Function vs Object

OOP: mjölnir.smash() // mjölnir is an object FP: mjölnir.sm...

Is Object-Oriented Programming "Dangerous"?

My data are also immutable in my applications, I pass param...

Javascript for() {} Loop - Simplified

let x = ['Dillion', 45, 'Megida']; for (currentElement of x...

Is Object-Oriented Programming "Dangerous"?

Developers who hate on OOP don’t know how to use it. I perce...

Tests in pre-commit hooks and alternatives

Tests in pre-commit hooks is a very bad way. You need to co...

IDs vs Classes: a CSS Specificity Chapter

ID is identifier of one object in document. Class is a cate...

Writing a searchable “database” with pure HTML, CSS, and JS

Use JSON or w3schools.com/html/html5_webstorag...

PHP... yay or nay?

This is not against SOLID principles. Simply I don't use it...

7 Ways to Get the Most Out of Pair Programming

We use pair programming on one project. We change positions...

How to Bookmark commands in Terminal

I use symlinks, CDPATH and aliases. This is enought.

PHP... yay or nay?

String is not an array.

PHP... yay or nay?

Please add comment "Never do this!" into this part of code....

PHP... yay or nay?

This code will generate big problems in future. Never use i...

PHP... yay or nay?

PHP is way better than it used to be. OOP is perfect, databas...

Do you feel comfortable learning in your own language or do you prefer English? (For non English-native speakers)

I am native Czech speaker. I have been using Czech language...

Git 001 ~Add Alias to .gitconfig~

[alias] ci = commit co = checkout up = push ...

Tips For Validating HTML Form Inputs

User can bypass client-side validation.

Tips For Validating HTML Form Inputs

This is a first validation - on client. You need make a sec...

10 More Git Tricks That You Should Know

Add all private untracked files to .git/info/exclude help....

PHP - Elegant method call

This is a wrong way in my opinion. You need split data stru...

PHP - Elegant method call

$something = Something($params); Edit: Sorry, the right...

PHP - Elegant method call

Better way: $sendmail = new Sendmail(); $sendmail->han...

10 rules to code like NASA (applied to interpreted languages)

60x80 is enough for a class.

Important Abbreviations

Add links to an external dictionary, eg: TCP/IP: Transmi...

Imaginary Language Features

Use decorator.

My Git tips for a better life in your console

I recommend using git-aliases instead.

A Series of My Unfortunate Mistakes (When Writing Tests)

Write tests first! Nice article.

Anyone using VIM here?

Vim daily. Without VS Code.

A short example of how types can make your life easier

All items of enums are objects: ab = Audiobook('mp3') eb...

Unlimited git repositories

Other Git placement options: Secondary HDD or SSD, USB flas...

How to crawl website using #bash script?

use quotation marks around the variable name: wget "$url"....

Why switch is better than if-else

I got rid of all "else" in my programs. They are shorter, ...

How to crawl website using #bash script?

An unusable script with too much mistakes. Pure wget is bet...

The 7 most important software design patterns

Singleton is good pattern for create NullObject. Observer ...

Code Smell: No AND in Function name

I use method names: drink(), add(), find(), insert(), updat...

Easily Merge Multiple Java --classpath Arguments

An alternative to the for loop is the while loop with the s...

The Git Rebase Workflow

rebase master->feature merge feature->master

Are CSS and HTML programming languages?

No. HTML is a markup language, CSS is a style language.

How to Produce Readable Code

actions on objects: user.get(), user.add(), post.modify(), ...

I created a .gitignore command-line generator !

Create an alias to Git to write: git ignore -h ...

How To Enforce Conventional Commit Messages Using GIT Hooks

I prefer to explain the pattern when validation fails. Goo...

//TODO: Write a better comment

interface AccountDAO { suspend fun insert(account: Acco...

Using isset() and empty() hurts your code

Deep structures are unwanted in OOP. Maybe you use it for rea...

Please, do not pollute project's .gitignore

Look for .git/info/exclude too. It is good for project spec...

Storing permissions ~ AoaH Nine

$username = 'myName" OR "1';

How did linguistics influence programming?

Naming things: class, object, variable - nouns function, ...

What tense do you use in Git Commit messages?

Imperative for simplicity and for non-english readers.

How to use git efficiently

Where is a branch bugfix?

Basic Text Formatting in PHP using printf() with decimals, prices, strings, and dates

$date = date("m/d/Y"); echo $date;

Up your git game with --patch

Thanks for your article!

How to Get the Git Directory

$ git config --global alias.pwd '!pwd' $ git pwd

Up your git game with --patch

You changed (destroyed) functionality in first hunk - you d...

How I Backup/Sync my Dotfiles & Apps

$ cat .gitignore * !.gitconfig !.gitignore !.bashrc !.zshr...

Help Me Name My New Computer

I use the names of heroes, constellations, stars and satell...

Security holes in PHP

This is not vulnerability PHP. This is bad manipulation wit...

Security holes in PHP

Use complex SQL or transaction.

Security holes in PHP

Some example? I have no problem with this.

Shellscripting: Functions

#!/bin/bash for i in $@; do echo "$i" done $ ./args.sh ...

My Git Aliases

gs has an unpleasant collision with GhostScript.

PHP XML Reader Example

When using large XML with a DOMDocument... $doc = new \DOM...

loading...