- 0 Posts
- 45 Comments
I did it once to pull out data from a spreadsheet into a database. Specifically, I needed
"${DataType}${Month}"for each month for 3 different datatypesIirc, i used an sql pivot (or unpivot) in that query too
Usually, it’s situations like this where you’re parsing data from strings, and you need some glue code to interface between the input data, and the date library you’re using to actually resolve the datetime
Lightfire228@pawb.socialto
Programmer Humor@programming.dev•Works if manually restarted by an intern from time to time
92·25 days agoUse SystemD timers, you animal
Lightfire228@pawb.socialto
Selfhosted@lemmy.world•Chhoto URL v6.3.0 is out now: A simple, blazingly fast, selfhosted URL shortener with no unnecessary features; written in Rust.English
312·2 months agoImo, it’s nice to see tools written in a memory safe systems language
Especially if you use a lot of them. More utility, less attack surface
Lightfire228@pawb.socialto
Programmer Humor@programming.dev•Context: Docker bypasses all UFW firewall rules
5·2 months agoThink of it more like pre-canned build scripts. I can just write a script (
DockerFile), which tells docker how to prepare the environment for my app. Usually, this is just pulling the pre-canned image for the app, maybe with some extra dependencies pulled in.This builds an image (a non-running snapshot of your environment), which can be used to run a container (the actual running app)
Then, i can write a config file (
docker-compose.yaml) which tells docker how to configure everything about how the container talks to the host.- shared folders (volumes)
- other containers it needs to talk to
- network isolation and exposed ports
The benefit of this, is that I don’t have to configure the host in any way to build / host the app (other than installing docker). Just push the project files and docker files, and docker takes care of everything else
This makes for a more reliable and dependable deploy
You can even develop the app locally without having any of the devtools installed on the host
As well, this makes your app platform agnostic. As long as it has docker, you don’t need to touch your build scripts to deploy to a new host, regardless of OS
A second benefit is process isolation. Should your app rely on an insecure library, or should your app get compromised, you have a buffer between the compromised process and the host (like a light weight VM)
In my obsidian notes folder, i have
- 01 - Inbox
- 02 - Breadbox
- 03 - Data
.
- Inbox is for newly created notes
- Breadbox is for notes that i need to reference or otherwise want quick access to
- Data is for everything else
For file navigation, i use links and references within the notes themselves, which creates a network of linked files that is far far easier to navigate than folders
Everything else is sorta all over the place, but in general
- ~/Documents
- dumping ground for important documents, folders are arbitrarily made as I go
- ~/Downloads
- dumping grounds for downloaded things, generally important files are moved elsewhere
- ~/Code is where i put all of my personal projects and other junk related to programming
~/ is the user home directory
- C:\Users\Name for windows
- /home/name for linux
For pictures, i use a self hosted Immich instance
Apply directly to the forehead
Lightfire228@pawb.socialto
Programmer Humor@programming.dev•Object oriented programming in Python be like:
8·3 months agoAt least python has a decent runtime typing system
JS’s type system feels like what you’d get by giving a monkey access to unlimited cocaine and a computer
Lightfire228@pawb.socialto
Programmer Humor@programming.dev•Object oriented programming in Python be like:
52·3 months agoSorry, I’m too Rust-pilled for this OOP nonsense
pub fn new() -> Self { Self::self().self.unwrap() }
Lightfire228@pawb.socialto
Programmer Humor@programming.dev•Learning to program in rust
3·4 months agoI can confirm, I’ve never used a non memory managed language, and the Rust borrow checker is a massive kick in the teeth
But, the more i consider it from the perspective of memory, and pointers, the borrow checker makes a lot of sense
Especially when storing references inside structs, and how mutability affects references
I actually figured out i could fix a re-mutable borrow error by performing the two mutable operations in separate for loops
Lightfire228@pawb.socialto
Programmer Humor@programming.dev•It's not a bug, it's a feature
3·4 months agoBlue cheese is intentionally inoculated with mold. Specifically penicillium mold that is perfectly safe to eat.
If a cheese “naturally” develops mold, there’s a good chance it could be harmful, so don’t eat that
To explain
There are 2
Errorstruct / enum declarations, probably in separate filesTo the
?, they are different types and cannot be converted from one to the other (because they are two disparate structs that happen to have the same name, but can have different bodies)To fix this
You can either use
.some_func_result().map_err(|err| /* conversion here/*)?;+Or you can
impl From<Error1> for Error2And you should also name it
ThingError, so you can visually differentiate the two
+ There are like 10 different mapping functions, depending on if you’re using an option or a result
I never remember which one specifically i need, (
unwrap_or,map_or,map_or_else,ok,ok_or)I usually just hunt through the auto complete list until i find the function signature that gives me what i need
The SoC on the motherboard has a special EDL mode
This is kinda like the SoC’s pre-bootloader, which loads the bootloader and can be used to flash a new bootloader
EDL mode is locked behind vendor specific certs/keys, so it’s unaccessible to the device owner
Lightfire228@pawb.socialto
Linux@programming.dev•End of 10 is a campaign to move people over to Linux with Windows 10 support ending
15·6 months agoProton / wine is modern day magic
Most Windows only steam games work out of the box (you do have to enable it in the right click menu > Compatibility options, per game)
Games that use Anti-cheat aren’t likely to work (it depends on the Anti-cheat used and how it’s configured)
ProtonDB is a good resource for checking if/which games work, or fixes and workarounds
You can use proton or wine on non steam games, but that requires additional setup that I’m not familiar with
Lightfire228@pawb.socialto
Programmer Humor@programming.dev•The future of web development is AI. Get on or get left behind.
9·6 months agoQuality work will always need human craftsmanship
I’d wager that most revolutionary technologies are either those that expand human knowledge and understanding, and (to a lesser extent) those that increase replicability (like assembly lines)
Sometimes you forget to verify if your assumptions are true
I just have a spell checker enabled in vscode
So helpful for dynamic languages that can’t detect undeclared variables (looking at you JS)
I was reading Crafting Interpreters. After adding function calls and stack frames, i tested my implementation with the Fibonacci script at the end of the chapter
I spent about 2 hours debugging my call stack, and even tested the script in Python
Only to realize that Fib(3) is indeed 2
Lightfire228@pawb.socialto
Programmer Humor@programming.dev•The general feeling of documentating things
13·6 months agoI’m not sure that’s their intended design. Old pull-tab cans actually had a ring for you to pull them off (similar to “easy open” soup cans of today)
I’d imagine that as the tab shrunk and changed from pull to a lever action, the “ring” was left as a vestigial design (as a form of skeuomorphism)


I use Hoppscotch
https://github.com/hoppscotch/hoppscotch