Julia Evans' Git cheat sheet
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearRO
    robinm
    3w ago 100%

    There are cases where instead of origin/master..HEAD you may want to use @{upstream}..HEAD instead to compare with the upstream of your current branch. It's unfortunately quite unknown.

    1
  • Hot takes on the state of Rust v C/C++ for safety (mastodon cross post)
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearRO
    robinm
    3mo ago 100%

    This post from 2022 was very interesting:

    There are approximately 1.5 million total lines of Rust code in AOSP across new functionality and components [...] These are low-level components that require a systems language which otherwise would have been implemented in C++.

    To date, there have been zero memory safety vulnerabilities discovered in Android’s Rust code.

    https://security.googleblog.com/2022/12/memory-safe-languages-in-android-13.html

    6
  • rust
    Rust 3mo ago
    Jump
    This Week in Rust 555 · This Week in Rust
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearRO
    robinm
    3mo ago 100%

    The quote (and the associated discussion) is such an important part of Rust and why I love this language so much. Anything that can be automated should at one point be automated reliably, and the sooner the better.

    1
  • git
    Git 5mo ago
    Jump
    What were your misconceptions about Git when you first started?
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearRO
    robinm
    5mo ago 100%

    It's a question of workflow. Git doesn't guide you (it's really workflow agnostic) and I find it easier to taillor CLI to fit my exact need, or use whatever was recently added (like worktrees a few years ago). I have yet to find a GUI/TUI that I'm not frustrated with at one point but everyone has its own preferences.

    1
  • git
    Git 5mo ago
    Jump
    What were your misconceptions about Git when you first started?
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearRO
    robinm
    5mo ago 100%

    If you use the git command line (and I do) you should spam git log --graph (usualy with --oneline).

    And for your filesystem example I sure do hope you use tree!

    1
  • Hello, I’m trying to follow Lennard Poetting (@pid_eins@mastodon.social) from my programming.dev account without success. On [its user profile on mastodon.social](https://mastodon.social/@pid_eins), when I click on the “follow” button, then enter “programming.dev” (which is in the completion list) then “take me home”, I am redirected to https://programming.dev/authorize_interaction?uri=https%3A%2F%2Fmastodon.social%2Fusers%2Fpid_eins which is a 404 error. I also tried to search for “@pid_eins@mastodon.social” directly from programming.dev, found it, but 0 toot, and no button to be able to follow it. Am I doing something wrong? Is mastodon.social and programming.dev not federated?

    11
    2
    isBooleanTooLongAndComplex
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearRO
    robinm
    6mo ago 100%

    I absolutely agree that method extraction can be abused. One should not forget that locality is important. Functionnal idioms do help to minimise the layer of intermediate functions. Lamda/closure helps too by having the function much closer to its use site. And local variables can sometime be a better choice than having a function that return just an expression.

    2
  • isBooleanTooLongAndComplex
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearRO
    robinm
    6mo ago 100%

    Good advice, clear, simple and to the point.

    Stated otherwise: "whenever you need to add comments to an expression, try to use named intermediate variables, method or free function".

    8
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hacker News 6mo ago
    Jump
    Most Tech Jobs Are Jokes and I Am Not Laughing
    "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hacker News 6mo ago
    Jump
    Doom-htop: The classic DOOM game over htop
    git
    Git 7mo ago
    Jump
    Modern Git Commands and Features You Should Be Using
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearRO
    robinm
    7mo ago 100%

    It's so anoying that at $WORK we have multiple git repos with symbolic link that points above their respective .git to each other and need to be in sync. So of course git workree and git bisect don't work that well…

    2
  • git
    Git 7mo ago
    Jump
    Modern Git Commands and Features You Should Be Using
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearRO
    robinm
    7mo ago 100%

    For those who don't know (I assume you do), you can git bisect run some_command and git will automatically run git bisect until it finds the falty commit. It's amazing.

    5
  • Any tips to help a scientist become a better programmer?
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearRO
    robinm
    7mo ago 100%

    Read your own code that you wrote a month ago. For every wtf moment, try to rewrite it in a clearer way. With time you will internalize what is or is not a good idea. Usually this means naming your constants, moving code inside function to have a friendly name that explain what this code does, or moving code out of a function because the abstraction you choose was not a good one. Since you have 10 years of experience it's highly possible that you already do that, so just continue :)

    If you are motivated I would advice to take a look to Rust. The goal is not really to be able to use it (even if it's nice to be able able to write fast code to speed up your python), but the Rust compiler is like a very exigeant teacher that will not forgive any mistakes while explaining why it's not a good idea to do that and what you should do instead. The quality of the errors are crutial, this is what will help you to undertand and improve over time. So consider Rust as an exercice to become a better python programmer. So whatever you try to do in Rust, try to understand how it applies to python. There are many tutorials online. The official book is a good start. And in general learning new languages with a very different paradigm is the best way to improve since it will help you to see stuff from a new angle.

    30
  • git
    Git 8mo ago
    Jump
    The Git Parable
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearRO
    robinm
    8mo ago 100%

    I reread that article every years for a few years. Each time my understanding of git improved significantly.

    2
  • rust
    Rust 8mo ago
    Jump
    Should I file a bug report? 😀
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearRO
    robinm
    8mo ago 100%

    I wasn't clear enough. But in a contry where the sun rise at 20:00, the weekday looks like:

    • day 1: Monday morning to Tuesday evening
    • day 2: Tuesday morning to Wednesday evening
    • day 3: Wednesday morning to Thurday,

    And phares like "let's meet on Tuesday“ without hour indication could either mean end of day 1 or start of day 2. Likewise "let's meet the 20th” (assuming the 20th is a Tuesday) could either mean end of day 1 or beggining of day 2.

    --

    And alternative be to have

    • day 1 == Monday == “end of the 19th” to “the start of the 20th”
    • day 2 == Tuesday == “end of the 20th” to “the start of the 21st”
    • day 3 == Monday == “end of the 21st” to “the start of the 22nd”

    Which solve the issue of "let's meet on Tuesday”, but not “let's meet the 20th”.

    1
  • https://lwn.net/Articles/954974/

    The Rust for Linux (RFL) project may not have (yet) resulted in user-visible changes to the Linux kernel, but it seems the wider world has taken notice. Hongyu Li has [announced](https://rust-for-linux.zulipchat.com/#narrow/stream/288089-General/topic/We.20build.20a.20Rust.20Realtime.20Operating.20System.28.60RROS.60.29.20using.20RFL!/near/407428553) that the Rust for Linux code is now part of a satellite just [launched](https://bupt-os.github.io/website/news/2023_12_9/satellite_launch/) out of China. The satellite is running a system called [RROS](https://github.com/BUPT-OS/RROS), which follows the old RTLinux pattern of running a realtime kernel alongside Linux. The realtime core is written in Rust, using the RFL groundwork. > Despite its imperfections, we still want to share RROS with the community, showcasing our serious commitment to using RFL for substantial projects and contributing to the community's growth. Our development journey with RROS has been greatly enriched by the support and knowledge from the RFL community. We also have received invaluable assistance from enthusiastic forks here, especially when addressing issues related to safety abstraction (Thanks to Dirk Behme).

    23
    0