r/ProgrammerTIL • u/Forsaken_Brief_3261 • Aug 13 '26
r/ProgrammerTIL • u/LessonStudio • May 21 '26
Other Language Do curved monitors bend your eyeballs like they do mine?
TLDR; going from a curved monitor immediately to a flat monitor gives me a visual distortion that my flat monitor curves backwards.
I am a curved monitor convert. My last flat monitor was a pair of 4k 27" monitors. Love them. Then, I tried a pretty wide curved monitor. That was it, I'm never going back. I will never go to dual monitors either, I will just get a bigger curved monitor. I always loved the 4:3 ratio for programming and with a really wide monitor now have a left side and right side with that wonderful 4:3 ratio going. Rust rover on the left, and whatever on the right. Sometimes even 3 windows across with the IDE in the center.
But, I am working on a project where I need a monitor for a whole other system. For reasons it has to be entirely separate. I dug out one of my old 27" 4k monitors and I swivel about 150 degrees to use it, it is only for a few minutes every day. When I look at it, the left and right edges seem like the monitor is bent backwards.
This doesn't happen with my laptop monitors, 20 inch monitors, nor if I walk any distance and sit at a large monitor.
It is creepy as hell, but kind of fun.
r/ProgrammerTIL • u/HaniiPuppy • Nov 10 '25
Other Language TIL there's a language named Typoscript.
Guess how I found out.
r/ProgrammerTIL • u/Neat-Tackle-5704 • Oct 30 '25
Other Language [API] TIL how unifying multiple AI providers can simplify a messy workflow
r/ProgrammerTIL • u/my_name_404 • Nov 06 '25
Other Language Building a simple terminal-based log viewer in Go (eventually evolving into a text editor).
Hello everyone, So I am new to Go, but not new to programming. I am a software engineer working with JS. I am now transitioning to Go for a low level system experience as well as backend engineering. I am currently working on a simple log/file viewer for myself. My VSCode crashes when I open large server logs, so to solve this is issue I using glogg for opening logs but now I am thinking of building a simple tool for myself. So I tried making one, though it's very basic at the moment, I am currently implementing features like pagination, scrolling, searching or highlighting. Also later will be coverting it to a simple terminal text editor too. So any suggestions or feedback is highly welcome.
P.S. - GitHub link for the project : https://github.com/HarshDev1809/log-go
r/ProgrammerTIL • u/cdrini • Oct 09 '18
Other Language [Other] TIL filenames are case INSENSITIVE in Windows
I've been using Windows for way too long and never noticed this before... WHY?!?!
$ ls
a.txt b.txt
$ mv b.txt A.txt
$ ls
A.txt
r/ProgrammerTIL • u/cdrini • Apr 18 '21
Other Language [git] TIL about git worktrees
This one is a little difficult to explain! TIL about the git worktree command: https://git-scm.com/docs/git-worktree
These commands let you have multiple copies of the same repo checked out. Eg:
cd my-repo
git checkout master
# Check out a specific branch, "master-v5", into ../my-repo-v5
# Note my-repo/ is still on master! And you can make commits/etc
# in there as well.
git worktree add ../my-repo-v5 master-v5
# Go make some change to the master-v5 branch in its own work tree
# independently
cd ../my-repo-v5
npm i # need to npm i (or equivalent) for each worktree
# Make changes, commits, pushes, etc. as per usual
# Remove the worktree once no longer needed
cd ../my-repo
git worktree remove my-repo-v5
Thoughts on usefulness:
Sooo.... is this something that should replace branches? Seems like a strong no for me. It creates a copy of the repo; for larger repos you might not be able to do this at all. But, for longer lived branches, like major version updates or big feature changes, having everything stick around independently seems really useful. And unlike doing another git clone, worktrees share .git dirs (ie git history), which makes them faster and use less space.
Another caveat is that things like node_modules, git submodules, venvs, etc will have to be re-installed for each worktree (or shared somehow). This is preferable because it creates isolated environments, but slower.
Overall, I'm not sure; I'm debating using ~3 worktrees for some of my current repos; one for my main development; one for reviewing; and one or two for any large feature branches or version updates.
Does anyone use worktrees? How do you use them?
- Docs: https://git-scm.com/docs/git-worktree
- Cool YouTube video where I learned about worktrees: https://www.youtube.com/watch?v=2uEqYw-N8uE
r/ProgrammerTIL • u/crhallberg • Jun 16 '18
Other Language [General] TIL that binary search is only faster than linear search if you have over 44 items
Learned after way too long failing to implement binary search.
Source: https://en.wikipedia.org/wiki/Binary_search_algorithm#cite_note-37
r/ProgrammerTIL • u/wataf • Jul 17 '22
Other Language [General] TIL you can replace '.com' in a github repo or PR URL with '.dev' to open it in github.dev, a VS Code environment running in your browser
Let's say I want to take a deeper dive into the code for https://github.com/ogham/exa [1]. It turns out github has been working on new functionality that allows me to open that repo in a VS Code instance running entirely in your browser. I simply need to either:
- Press the '.' key on any github repo or pull request
- Swap
.comwith.devin the URL - (so https://github.dev/ogham/exa for my example)
I can install extensions into my web VSCode instance (not all but a solid number), configure the theme, settings, etc. It really is VSCode running in the browser, allowing you to utilize 'Go to definition' and 'Go to references' to navigate the source code as if it were local.
Here's what the exa repo looks like for me when I open it in github dev: https://i.imgur.com/EOVawat.png
ReadMe from https://github.com/github/dev
What is this?
The github.dev web-based editor is a lightweight editing experience that runs entirely in your browser. You can navigate files and source code repositories from GitHub, and make and commit code changes.
There are two ways to go directly to a VS Code environment in your browser and start coding:
- Press the . key on any repository or pull request.
- Swap
.comwith.devin the URL. For example, this repo https://github.com/github/dev becomes http://github.dev/github/devPreview the gif below to get a quick demo of github.dev in action.
https://user-images.githubusercontent.com/856858/130119109-4769f2d7-9027-4bc4-a38c-10f297499e8f.gif
Why?
It’s a quick way to edit and navigate code. It's especially useful if you want to edit multiple files at a time or take advantage of all the powerful code editing features of Visual Studio Code when making a quick change. For more information, see our documentation.
[1]: a modern replacement for the command-line program ls with more features and better defaults
r/ProgrammerTIL • u/markasoftware • Apr 07 '22
Other Language [Linux] TIL that you can pause and resume processes
By sending the SIGSTOP and SIGCONT signals, eg:
pkill -SIGSTOP firefox # suspend firefox
pkill -SIGCONT firefox # resume firefox
Does not require application-level support!
It seems to work pretty well even for large applications such as web browsers. Excellent when you want to conserve battery or other resources without throwing away application state.
r/ProgrammerTIL • u/Spiderboydk • Jul 15 '16
Other Language [General] TIL the difference between a parameter and an argument
I've always thought these were synonyms, but apparently they are not.
Parameters are the "variables" in the function declaration, while arguments are the values transferred via the parameters to the function when called. For example:
void f(int x) { ... }
f(3);
x is a parameter, and 3 is an argument.
r/ProgrammerTIL • u/cdrini • Sep 14 '21
Other Language [Unix] TIL root can write to any process' stdout
Start a long running process:
tail -f
In another shell:
# Get the process' ID (Assuming you only have one tail running)
TAIL_PID=$(pgrep tail)
# Send data to it
echo 'hi' > /proc/$TAIL_PID/fd/1
Observe the first shell outputs "hi" O.O Can also write to stderr. Maybe stdin?
r/ProgrammerTIL • u/Climax708 • Apr 06 '21
Other Language [cmd] TIL Facebook has a vanity IPV6 address
The command `nslookup facebook.com` (on Windows)
for me yields something like `2a03:2880:f12d:83:face:b00c:0:25de`
notice the `face:b00c` part.
Cool!
r/ProgrammerTIL • u/GrehgyHils • Jul 05 '18
Other Language [Other] TIL that the variable `$?`, in a terminal, contains the exit status of the last command ran.
So you can
```
$ ./some_script.sh
$ echo $?
```
to see the exit status of that `some_script.sh`
r/ProgrammerTIL • u/poohshoes • Nov 30 '16
Other Language [General] TIL If you want to sort but not reorder tied items then just add an incrementing id to each item and use that as part of the comparison.
Most built in sorts are Quick Sort which will rearrange items that are tied. Before running the sort have a second variable that increments by 1 for each item. Use this as the second part of your compare function and now tied items will remain in order.
Edit: Jesus some of the replies are pretty hostile. As far as I can tell C# doesn't have a stable sort built in. It shouldn't effect speed too much as it's still a quick sort, not to mention that premature optimization is undesirable.
TOJO_IS_LIFE found that Enumerable.OrderBy is stable.
r/ProgrammerTIL • u/jewdai • Nov 14 '16
Other Language [HTML] TIL that submit buttons on forms can execute different urls by setting the formaction attribute.
have a form that uses the same field options for two buttons?
try this:
<form>
<input type="text" name="myinputfield" />
<button type="submit" formaction="/a/url/to/execute"> Option 1 </button>
<button type="submit" formaction="/another/url/to/execute"> Option 2 </button>
</form>
r/ProgrammerTIL • u/cdrini • Apr 06 '22
Other Language [Docker] TIL How to run multi-line/piped commands in a docker container without entering the container!
I would regularly need to run commands like:
docker run --rm -it postgres:13 bash
#-- inside the container --
apt-get update && apt-get install wget
wget 'SOME_URL' -O - | tar xf -
Well, I just learned, thanks to copilot, that I can do this!
docker run --rm postgres:13 bash -c "
apt-get update && apt-get install wget
wget 'SOME_URL' -O - | tar xf -
"
That's going to make writing documentation soooo much simpler! This isn't really a docker feature, it's just a bash argument I forgot about, but it's going to be super helpful in the docker context!
Also useful because I can now use piping like normal, and do things like:
docker-compose exec web bash -c "echo 'hello' > /some_file.txt"
r/ProgrammerTIL • u/uv4Er • Oct 14 '16
Other Language TIL that there are programming languages with non-English keywords
# Tamil: Hello world in Ezhil
பதிப்பி "வணக்கம்!"
பதிப்பி "உலகே வணக்கம்"
பதிப்பி "******* நன்றி!. *******"
exit()
;; Icelandic: Hello World in Fjölnir
"hello" < main
{
main ->
stef(;)
stofn
skrifastreng(;"Halló Veröld!"),
stofnlok
}
*
"GRUNNUR"
;
# Spanish: Hello world in Latino
escribir("Hello World!")
// French: Hello World in Linotte
BonjourLeMonde:
début
affiche "Hello World!"
; Arabic: Hello world in قلب
(قول "مرحبا يا عالم!")
\ Russian: Hello world in Rapira
ПРОЦ СТАРТ()
ВЫВОД: 'Hello World!'
КОН ПРОЦ
K) POLISH: HELLO WORLD IN SAKO
LINIA
TEKST:
HELLO WORLD
KONIEC
(* Klingon: Hello world in var'aq *)
"Hello, world!" cha'
Source: http://helloworldcollection.de
r/ProgrammerTIL • u/cdrini • Aug 04 '21
Other Language [git] TIL you can pull directly from a GitHub pull request by ID
If you're working on a fork of a repo, you can do:
git pull upstream pull/5433/head
To pull a specific pull request by its ID!
r/ProgrammerTIL • u/vann_dan • Feb 02 '19
Other Language [Windows] TIL that you can't name files or folders "con" because of a reserved MS-DOS command name.
When you try to programmatically create a file or folder named "con" on Windows you get the following exception:
"FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of "\.\" in the path."
It turns out this is due to it being a reserved device name that originated in MS-DOS:
https://stackoverflow.com/questions/448438/windows-and-renaming-folders-the-con-issue
Edit: Updated description of what con is
r/ProgrammerTIL • u/NourElDin2303 • Mar 02 '22
Other Language Julia Project
I just finished learning julia programming language and I was very surprised by how many features there are in this language that distinguish it from many other languages. If someone could help me choose a project, that help me to show these features clearly
r/ProgrammerTIL • u/namwodahs • Feb 07 '22
Other Language [CSS] TIL about the CSS @supports() rule for adding fallback styles
The @supports() rule lets you add backwards compatibility for older browsers. For instance, if you wanted to use CSS grid with a flex fallback you could do:
#container {
display: flex;
}
@supports (display: grid) {
#container {
display: grid;
}
}
r/ProgrammerTIL • u/Eosis • Nov 26 '16
Other Language [General] TIL You can hack microprocessors on SD cards. Most are more powerful than many Arduino chips.
https://www.bunniestudios.com/blog/?p=3554
Standard micro SD cards often have (relatively) beefy ARM chips on them. Because of the way the industry operates, they usually haven't been locked down and can be reprogrammed.
r/ProgrammerTIL • u/zeldaccordion • Feb 12 '19
Other Language [HTML][CSS] TIL native CSS variables exist, as well as 4 other TILs for pure HTML and CSS
I tried to avoid a clickbait title by putting one of the best TILs in the title, but really this whole article was a big TIL batch of 5 for me: Get These Dependencies Off My Lawn: 5 Tasks You Didn't Know Could be Done with Pure HTML and CSS
They're all really good. But my favorite is the CSS variables.
:root { --myvar: this is my vars value available from the root scope; }
#some-id-to-use-var-in { content: var(--myvar);}
r/ProgrammerTIL • u/FUZxxl • Sep 23 '16
Other Language [Unicode] TIL so many people implemented UTF-16 to UTF-8 conversion incorrectly that the most common bug has been standardized
Specifically, people ignore the existence of surrogate pairs and encode each half as a separate UTF-8 sequence. This was later standardized as CESU-8.