Readit News logoReadit News
mtift commented on I'm “still afraid to use spaces in file names” years old   twitter.com/TheIdOfAlan/s... · Posted by u/dario_satu
l0b0 · 4 years ago
If you're a developer you're doing yourself a big disservice by not learning how to deal with special characters.
mtift · 4 years ago
I agree. I am a developer and I know how to deal with special characters. But this isn't something I use professionally. I just prefer not to have to deal with special characters in the pdfs, m4as, txts, and other files that I use on a daily basis. When I write papers, I'll write ū or Ñ or ç or whatever (incidentally, I have a lot of shortcuts in my .vimrc for those). I would not say I am "afraid" to use spaces in filenames, but I get a certain satisfaction storing academic papers in the author--paper-title.pdf format and my notes in author--paper-title.md because it helps me find things.
mtift commented on I'm “still afraid to use spaces in file names” years old   twitter.com/TheIdOfAlan/s... · Posted by u/dario_satu
nybble41 · 4 years ago
That's the most beautiful part! After running this script there are no more conflicts, because it just silently overwrites all but one version of the "cleaned" filename.

(Also—that entire function is super inefficient and could be replaced with a single invocation of "rename".)

mtift · 4 years ago
Totally inefficient. But for me it's readable and practical. This is mostly just a convenience function for me to help store files in a format I like rather than something I need optimized. If it ever started to feel slow, sure I could optimize. But for now, when I still occasionally download a file that has some weird character and I just prefer to add another line to my function.
mtift commented on I'm “still afraid to use spaces in file names” years old   twitter.com/TheIdOfAlan/s... · Posted by u/dario_satu
theshowmustgo · 4 years ago
Nice but how do you prevent overwrites? What about directories/folders and the files in that directory/folder?

I have:

  Movie Bla (2020)
    Movie Bla (2020).mp4
But also:

  Movie_Bla_(2020)
    Movie_Bla_(2020).mp4
    Movie_Bla_(2020).srt
Would not like to lose files like the the srt.

mtift · 4 years ago
Yeah, sometimes I end up renaming things I don't want to, but it really doesn't happen all that often. And sometimes I throw caution to the wind, add some excitement to my life, and rename a bunch of files (not for anything professional) in some really old directory and hope I don't break anything. But I'm not aiming for perfect with this comment. I just mentioned in another comment, but the vast majority of times I run this is in my ~/Downloads folder on files I don't really worry about breaking.
mtift commented on I'm “still afraid to use spaces in file names” years old   twitter.com/TheIdOfAlan/s... · Posted by u/dario_satu
OskarS · 4 years ago
Overly aggresive is right! I don't know if this is genius or deranged! I'm leaning towards genius and stealing the idea.

By the way: what's your beef with en dashes? I mean, if it was "everything should be 'HYPHEN-MINUS' (U+002D)", then fine, but why specifically en dashes and not em dashes?

mtift · 4 years ago
I totally agree that for some people, this could be a terrible command to have around. However, I know that it has been working for me for about 8+ years or so. I almost always run in in my ~/Downloads folder on files that I don't really care about. I download a lot of academic papers and books, and this just saves me a lot of time to put files in the format I like: author--paper-title.pdf. And that's part of the reason why I make all of the dashes the same, so if I'm opening something by an author, I can easily autocomplete and not have to remember how to make other sorts of dashes on the command line.
mtift commented on I'm “still afraid to use spaces in file names” years old   twitter.com/TheIdOfAlan/s... · Posted by u/dario_satu
mtift · 4 years ago
I have an overly-aggressive function in my .bashrc to rename all files in the current directory:

  # Rename all files in a directory
  rn() {
    rename "s/ /-/g" *
    rename "s/_/-/g" *
    rename "s/–/-/g" *
    rename "s/://g" *
    rename "s/\(//g" *
    rename "s/\)//g" *
    rename "s/\[//g" *
    rename "s/\]//g" *
    rename 's/"//g' *
    rename "s/'//g" *
    rename "s/,//g" *
    rename "y/A-Z/a-z/" *
    rename "s/---/--/g" *
    rename "s/-‎--/--/g" *
  }
I use this all the time, especially when I download files.

mtift commented on MacBook Pro   apple.com/macbook-pro/... · Posted by u/rl3
vegasje · 9 years ago
Seems like my next laptop won't be a MacBook Pro.

Can anyone recommend a good Linux laptop that will offer up to 32gb of RAM and have decent battery life?

mtift · 9 years ago
http://shop.lenovo.com/us/en/laptops/thinkpad/t-series/t460

If you need 32GB of RAM, then the ThinkPad T460 would qualify. And Lenovo claims it has 18 hours of battery life, which seems more than decent to me.

I switched from MacBook Pros to the ThinkPad T Series running GNU/Linux a few years ago and I have not been disappointed. My only caveat is that I like to run Debian stable, and that seems to work better on older ThinkPads, especially for things like video chats. In my experience, the newer ThinkPads work better with distros that use newer kernels (at least I think that is why), such as Ubuntu or Fedora.

I would have suggested the T460s, which is lighter, but that only goes up to 20GB of RAM.

mtift commented on Who sponsors Drupal development?   drupal.org/blog/who-spons... · Posted by u/mtift
ajsalminen · 9 years ago
The level of sponsored contribution is interesting but not too surprising based on what we knew about some other open source projects. I wonder if there are other projects gathering this information the way Drupal is?
mtift · 9 years ago

u/mtift

KarmaCake day59July 19, 2012
About
Yoga teacher and developer https://rootaccessyoga.com
View Original