Skip Navigation

irelephant [he/him]🍭

@ Irelephant @lemm.ee

Posts
49
Comments
674
Joined
3 yr. ago

  • I hate to say it, but powershell is better than bash.

  • As much as I hate windows powershell is actually decent.

  • I started with (in order, give or take one or two): python, javascript, lua, c, bash, powershell

  • I wouldn't call it confusion, more just ick. I don't really like it.

  • I check if a user agent has gptbot, and if it does I 302 it to web.sp.am.

  • I know, but not all languages require it.

    For example, lua does the following:

      lua
        
    if true
    then
    print("hello")
    end
          hello
      
      

    but this also works:

      lua
        
    if true then
        print("hello")
    
    hello
    
      
  • After the if condition. No other language does that, so it feels unecessary.

  • Did you mean WSL? I mostly use it for that too because lua development on windows is ass.

  • I can do that as well:

     
        
    $l = Get-Content "example.txt" -TotalCount 1; Write-Output $l; ($l.TrimEnd("`r", "`n")).Length
      
      

    There's a condensed version using aliases then:

     
        
    $l = gc 'example.txt' -TotalCount 1; $l; ($l.TrimEnd("`r", "`n")).Length
    
    
      

    I still think it has a better syntax than bash.

  • Maybe you're a bit more used to the linux stuff then.

    https://lemm.ee/comment/20786033 -- I think powershell's syntax is far better than bash's. It feels more modern.

  • i[te]

    That is fucked up and its annoying that it works

  • Its a completely different shell, not just another terminal emulator.

    Its more readable, and its syntax is less arcane than bash.

    For example, a script to get the first line of a file and its lenght in bash is:

      bash
        
    #!/bin/bash
    
    
    if [ "$#" -ne 1 ]; then
        echo "Usage: $0 filename"
        exit 1
    fi
    
    filename="$1"
    
    
    if [ ! -r "$filename" ]; then
        echo "File '$filename' does not exist or is not readable."
        exit 1
    fi
    
    
    read -r first_line < "$filename"
    
    
    echo "First line: $first_line"
    
    
    length=${#first_line}
    
    echo "Length of first line: $length"
    
      

    There is so much I hate about this, like using a semicolon after the if condition, and ending it in fi.

    Versus the powershell version:

      powershell
        
    param (
        [Parameter(Mandatory = $true)]
        [string]$FilePath
    )
    
    
    if (-not (Test-Path -Path $FilePath)) {
        Write-Error "File '$FilePath' does not exist."
        exit 1
    }
    
    try {
        
        $firstLine = Get-Content -Path $FilePath -TotalCount 1
    }
    catch {
        Write-Error "Could not read from file '$FilePath'."
        exit 1
    }
    
    
    Write-Output "First line: $firstLine"
    
    
    $lineLength = $firstLine.Length
    Write-Output "Length of first line: $lineLength"
    
      

    It feels more modern.

  • There is 4 Rs in the word strawberry

  • "How many Rs in strawberry"

  • Powershell is annoyingly good though.

  •   regex
        
    ^(?:(?:feddit\.(?:it|ie|uk|org|de|nl))|(?:lemmy\.(?:cafe|ml|ca|org|world|zip|nz))|(?:sh\.itjust\.works|programming\.dev|lemm\.ee|sopuli\.xyz|jlai\.lu|lemmy\.blahaj\.zone|lemmy\.dbzer0\.com|aussie\.zone|beehaw\.org|lemmy\.sdf\.org|slrpnk\.net))$
    
      

    pretty sure this is correct.

  • You can if you have a lot of alts.

  • I am unbelievably shit at regex, and I didn't bother testing this one.

  • Meta (lemm.ee) @lemm.ee

    2 Instances are being used for coordinated vote manipulation, and should be defederated. chinese.lol lemmy.doesnotexist.club

  • Fediverse memes @feddit.uk

    Yay! More centralisation!

  • Fediverse @lemmy.world

    What features are missing from piefed, or, why aren't we reccommending piefed instead of lemmy?

  • Ask Lemmy @lemmy.world

    Do you prefer cut or uncut?

  • Fediverse memes @feddit.uk

    They have started federating again, lord help us.

  • Lemmy @lemmy.ml

    I read somewhere that lemmy is planning to edit links so that they point to your instance, how will this be handled?

  • Fediverse memes @feddit.uk

    Comment threads, on the default lemmy-ui.

  • Technology @lemmy.world

    Windows 11 is closing a loophole that let you skip making a Microsoft account

    www.theverge.com /news/638967/microsoft-windows-11-account-internet-bypass-blocked
  • Fediverse @lemmy.world

    There is a second wafrn instance now.

    evil.wafrn.net
  • Fediverse @lemmy.zip

    Internet forums are disappearing because now everything is Reddit and Discord. And that's worrying.

    www-xataka-com.translate.goog /servicios/foros-internet-estan-desapareciendo-porque-ahora-todo-reddit-discord-eso-preocupante
  • Fediverse @lemmy.world

    Why aren't lemmy DMs compatible with mastodon?

  • 196 @lemmy.blahaj.zone

    rule

  • Curated Tumblr @sh.itjust.works

    Ireland

  • Ask Lemmy @lemmy.world

    What redditisms do you hope DO come to lemmy?

  • Ask Lemmy @lemmy.world

    What redditisms do you hope don't come to lemmy?

  • Programmer Humor @programming.dev

    STOP DOING COMPUTER SCIENCE

  • Fedibridge @lemmy.dbzer0.com

    Made a post on discuit asking what drove them away from lemmy.

    discuit.org /AskDiscuit/post/jUa6Ks0u/182aa1b23218a6abad519d97
  • Fediverse @lemmy.world

    What if we called instances providers?

  • Fediverse @lemmy.world

    Anyone get these messages?

  • Fedibridge @lemmy.dbzer0.com

    What if we described federation as syncing?