There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

spez , in D or d come on

Fish baby. Fish.

pchem , in D or d come on
krey , in Memory is overrated

The trick is to name everything in a way so you don’t have to remember stuff. Like instead of class “Cronjob” method “process”, name it “ImageCacheEraser” and “purgeByContentID”. Same goes for variables. No need for short names. Nowadays, you can even write with short names at first, so typing is faster, then just use your IDE to rename them to full size afterwards.

Speculater ,
@Speculater@lemmy.world avatar

Just not too short or you’ll end up renaming a random variable you didn’t mean to… I’ve heard.

hemko ,

for i in…

krey ,

Some IDEs (like Netbeans, Intellij, PhpStorm) can rename only in the scope of the selected item. So if you used variable “a” in 2 methods, it would only rename in the selected method and it understands the variable is different from “ab” and won’t replace the “a” part of that.

idunnololz , in They Need To Stop Doing This
@idunnololz@lemmy.world avatar

Too real

fibojoly , in Steal What Is Stolen

Stealing implies depriving the original owner of something that you know possess.
The entire digital medium invalidates this concern by its very nature, yet we keep reintroducing it anyway.

JoMiran , in Memory is overrated
@JoMiran@lemmy.ml avatar

I’ve been at this for almost thirty years. At this point, I’ve forgotten more than I have ever learned.

OsrsNeedsF2P , in Memory is overrated

Is it my turn to repost this next week

the_artic_one OP , (edited )

I should write some documentation so I don’t have to remember which memes have already been posted here.

ObviouslyNotBanana ,
@ObviouslyNotBanana@lemmy.world avatar

You’ll never read it

bleistift2 , in Memory is overrated

Clean code, extensive documentation, help files and readmes aren’t supposed to prevent you from forgetting how it works. I’m not sure what you’re trying to tell me with the second half of this meme.

krashmo ,

That you’re taking things too seriously. It’s a meme not a dissertation.

spez , in Memory is overrated

I have a repo with another repo inside it which was the one deployed. I forgot how all of it worked and wasted like 4 hours combined. Definetly gonna write docs from now on.

noobdoomguy8658 ,

Definetly gonna write docs from now on.

Sure thing.

sbv ,

They’re serious this time

evatronic , in Memory is overrated

This is terrible! What half-witted shit-for-brains monkey crapped this craptacular crapfest out?! I swear to Kaballah Monster, as soon as I figure out…

git blame

…oh.

Feathercrown , in Steal What Is Stolen

Repost

xnasero , in D or d come on

Op does not know about $CDPATH and tab completion keke

PennyJim ,
@PennyJim@lemmy.world avatar

I’ve seen a number of comments imply the possibility of case insensitive tab completion. Is this real and how do I do it?

I have multiple times fumbled with forgetting to capitalize something, only for the terminal to ‘dunk’ at me

F04118F ,

There’s probably some way to add it in bash, but if you install zsh and use the default options for everything, it just works! I especially love zsh for things “just work”: not just tab completion for directories but also having completion for tools like git, docker, kubectl, etc is super easy, and you don’t need any weird magic like in Bash if you want to use an alias with the same completion

bnjmn ,

Hmm, it didn’t “just work” for me. I had to set it up recently:

zstyle ‘:completion:*’ matcher-list ‘’ ‘m:{a-zA-Z}={A-Za-z}’ ‘r:|=*’ ‘l:|=* r:|=*’

That line needs to go in .zshrc. Maybe it’s enabled by default with oh-my-zsh?

F04118F ,

I’m sorry, that must be it, I immediately installed oh-my-zsh after switching to zsh

bnjmn ,

I tend to always install both of them together too! Which makes it a little hard to know where things are coming from. This time I decided to start from scratch, so certain aspects of the config are still salient in my mind

zlatko ,

For bash, this is enough:


<span style="color:#323232;"># Bash TAB-completition enhancements
</span><span style="color:#323232;"># Case-insensitive
</span><span style="color:#323232;">bind "set completion-ignore-case on"
</span><span style="color:#323232;"># Treat - and _ as equivalent in tab-compl
</span><span style="color:#323232;">bind "set completion-map-case on"
</span><span style="color:#323232;"># Expand options on the _first_ TAB press.
</span><span style="color:#323232;">bind "set show-all-if-ambiguous on"
</span>

If you also add e.g.CDPATH=~/Documents, it will also always autocomplete from your Documents no matter which directory you’re on.

PennyJim ,
@PennyJim@lemmy.world avatar

Setting CDPATH=:~/Documents/Dev makes navigating to any of my projects so much easier.

Thanks for bringing it to my attention

csm10495 ,
@csm10495@sh.itjust.works avatar

Thanks kind stranger. Never knew of this.

zlatko ,

No problem!

As an aside, I see we’re bringing the strangers thing over from Reddit. I hope more of the fun and funny stuff gets over, I miss some of the light shitposting.

kattfisk ,

Well completion-ignore-case is enough to solve this particular problem, the other options are just sugar on top :)

I’m going to add completion-prefix-display-length to these related bonus tips (I have it set to 9). This makes it a lot easier to compare files with long names in your tab completion.

For example if you have a folder with these files:

FoobarSystem-v20.69.11-CrashLog2022-12-22 FoobarSystem-v20.69.11.config FoobarSystem-v20.69.12 FoobarSystem-v20.69.12-CrashLog2023-10-02 FoobarSystem-v20.69.12.config FoobarSystem-v20.69.12.userprofiles

Just type vim TAB to see


<span style="color:#323232;"> ...1-CrashLog2022-12-22   ...1.config   ...2   ...2-CrashLog2023-10-02   ...2.config   ...2.userprofiles
</span><span style="color:#323232;">$vim FoobarSystem-v20.69.1
</span>

GNU Readline (which is what Bash uses for input) has a lot of options (e.g. making it behave like vim), and your settings are also used in any other programs that use it for their CLI which is a nice bonus. The config file is ~/.inputrc and you’d enable the above mentioned options like this


<span style="color:#323232;">$include /etc/inputrc
</span><span style="color:#323232;">
</span><span style="color:#323232;">set completion-ignore-case on
</span><span style="color:#323232;">set show-all-if-ambiguous on
</span><span style="color:#323232;">set completion-map-case on
</span><span style="color:#323232;">set completion-prefix-display-length 9
</span>
FinancesDrone98 , in Intuitive UI

Finger-Lickin Good?

ArmokGoB , in It’s a game for kids!

Towers of Hanoi? I don’t think so.

Lmaydev , in Steal What Is Stolen

This meme doesn’t really work as all code has to be licensed.

redcalcium ,

GPL: if you steal this code, you must let other people steal your code as well

MIT: just steal this code, idgaf

Public domain: who made this code I just stole? ¯_(ツ)_/¯

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines