601 karma · joined September 3, 2013
bobbbygrayson[at]gmail.com, bsky.app/profile/@bobbby.online
The typing is governed by YAML standards. This is why symbols are left out. Since it uses `YAML.dump` and `YAML.load` with the set/get, it will automatically assume the string '1' is an integer, '1.0' a float, and so on.
> is it possible to enumerate the versions of key-values that have been saved?
Yes, using the `get_version` method, you could do something like:
all_items = $ITEMS[key].map { |hash| db.get(hash) }
I should add this as a normal function to the API. Its now on my todo list.For reference: I've never had a mania or true low since working with it this way, and if I did I would immediately seek a medicated solution knowing the severity of the situation. But, I've managed to hold a full time job, excel my career more than I thought possible, and generally be quite well physically professionally and mentally without it.
PS I emailed you the other day.
user system total real
set: 0.150000 0.080000 0.230000 ( 1.093421)
hash set: 0.110000 0.120000 0.230000 ( 1.085441)
get: 0.150000 0.040000 0.190000 ( 1.091698)
hash get: 0.110000 0.060000 0.170000 ( 1.075470)This was my initial reasoning for making it. However when I began looking into it on Twitter @steveklabnik informed me that Rust's crates.io uses a similar system [0]. I found this especially intriguing, but have not gotten in touch with someone who knows the codebase better to give me some more insight.
[0] https://twitter.com/steveklabnik/status/608778665825083392
In a sense. $ITEMS is a hash ruby-object whose keys are what is set as the key by the input, but its values are the hashes that are stored in the git filesystem. There are about 10,000,000 improvements this could have and by no means would I consider it production quality software. Any ideas on a better means of persistance knowing this? Could back up the dict itself as a string in the git filesystem and have it be restorable on instantiation, possibly...
I'd love to see a breakdown of it that might make understanding the more fine-grained pieces in a deeper/more complete sense.
Largely my experience has been 1/2 to full day pair programming sessions, building a sample application that does something reasonably nontrivial, or a combination of these two.
I really personally enjoy this practice. Even though a day of billed hours is a large opportunity cost, so is the expense of potentially hiring a bad fit for the team. It goes both ways.
This book is my personal favorite.
http://www.amazon.com/Calculus-Practical-Man-J-Thompson/dp/1...
Save my Bench Press
Save my Dead Lift
Now, I will have the success * message at the bottom from submitting my Dead Lift, but if I go to the bottom and delete it, this success message is still showing, even though I have deleted the value.
Adding a simple event handler for the click of the delete button to empty the container containing success messages would handle this.
Using the back button seems to keep trying to resubmit the form and break the page for me.
Also, you could remove the last result when an item is deleted from the page. It was displaying a record I had deleted because it was also the last submitted.
Really like the concept. I've always been a fan of doing core lifts like this and generally just keep it all in a notepad I jot on after I leave the gym.
That said, awesome illustration of building something useful with a minimal codebase and really embracing the nature of what the language is built upon. :)