• 2 Posts
  • 286 Comments
Joined 1 year ago
cake
Cake day: December 31st, 2023

help-circle

  • The technology behind the registry is fine (which is what I think @VinesNFluff meant)

    But it’s execution in Windows was ass

    In theory, a configuration manager with DB-like abilities (to maintain relationships, schematic integrity, and to abstract the file storage details), isn’t a bad idea

    But the registry as it is today is pure pain




  • Lightfire228toComic Strips@lemmy.worldisitdownrightnow dot com
    link
    fedilink
    arrow-up
    33
    arrow-down
    2
    ·
    8 days ago

    Software dev here,

    It doesn’t stop you from typing code, but it does drastically hinder the process. You often need to pull up technical documentation (for the language, framework, platform, etc), or search the internet for things, like “C# HttpClient how to serialize JSON with a different naming policy”

    Not to mention, if any of your dev resources are online, no Internet prevents you from running your code. Like, if you need to connect to an S3 bucket, AWS instance, or Azure Database





  • Lightfire228toProgrammer Humor@lemmy.mlCommit
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    14 days ago

    I mean, you just need to look at the conflicting files, fix up the code, then stage those changes and pop a new commit

    There’s no “special” merge conflict resolution commit “type”


    As for fixing the code itself, I usually look at what changed between both versions, and then re-author the code such that both changes make “sense”





  • Lightfire228toComic Strips@lemmy.worldFeel Good Stories
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    20 days ago

    Any time you feel that sinking feeling especially while browsing c/all or such, close the app and do something else

    Doomscrolling is not worth your sanity


    This is the reason I recently unsubed from a bunch of meme threads on Lemmy. They were a non-stop barrage of political doom posting.

    Understandable, given current events. But it was too much for me






  • that is a little more complicated

    p.communicate() will take a string (or bytes) and send it to the stdin of the process, then wait for p to finish execution

    there are ways to stream input into a running process (without waiting for the process to finish), but I don’t remember how off the top of my head

    
    from shutil import which
    from subprocess import Popen, PIPE, run
    from pathlib import Path
    
    LS   = which('ls')
    REV  = which('rev')
    
    ls   = run([LS, Path.home()], stdout=PIPE)
    
    p = Popen([REV], stdin=PIPE, stdout=PIPE)
    stdout, stderr = p.communicate(ls.stdout)
    
    print(stdout.decode('utf-8'))
    


  • just use python instead.

    • wrap around subprocess.run(), to call to system utils
    • use pathlib.Path for file paths and reading/writing to files
    • use shutil.which() to resolve utilities from your Path env var

    Here’s an example of some python i use to launch vscode (and terminals, but that requires dbus)

    
    from pathlib import Path
    from shutil import which
    from subprocess import run
    
    def _run(cmds: list[str], cwd=None):
        p = run(cmds, cwd=cwd)
    
        # raises an error if return code is non-zero
        p.check_returncode()
    
        return p
    
    VSCODE = which('code')
    SUDO   = which('sudo')
    DOCKER = which('docker')
    
    proj_dir = Path('/path/to/repo')
    
    docker_compose = proj_dir / 'docker/'
    
    windows = [
      proj_dir / 'code',
      proj_dir / 'more_code',
      proj_dir / 'even_more_code/subfolder',
    ]
    for w in windows:
      _run([VSCODE, w])
    
    _run([SUDO, DOCKER, 'compose', 'up', '-d'], cwd=docker_compose)