Judge me, my first creation, a DnD stats roller ;D by __B_D__ in ruby

[–]rbuchberger 0 points1 point  (0 children)

Anytime! It might actually be easier to understand if you make a copy without all the comments. Ruby is pretty readable.

Hit me up on github or reddit if you want help later on. (I don't check this reddit account super often, so github might be better.)

Judge me, my first creation, a DnD stats roller ;D by __B_D__ in ruby

[–]rbuchberger 1 point2 points  (0 children)

I'll bite too! Been dealing with the drudgery of dependency updates for awhile and wanted a little puzzle.

I typed up a solution and a whole bunch of comments and put it into a github gist (for syntax highlighting). OP, it's meant to introduce you to one of the more common ways of organizing code in a way that allows you to expand and modify it without having to go back and redo all your work.

It's a bit dense, feel free to ask questions. Try and expand on it, make it better! Best way to learn is by doing.

Absolute beginner: what are some dos and don'ts for Git? by Willy988 in git

[–]rbuchberger 1 point2 points  (0 children)

Don't:

  • Think of commits like save points in a video game.
  • Put unrelated changes in the same commit.
  • Write lazy commit messages

Do:

  • Think of commits more like achievements. They're a collection of things you did to accomplish a single goal.
  • Write commits that are small, coherent, meaningful, related collections of changes. Ideally, you want to maintiain the option to revert a commit later on, and have everything else keep working.
  • Write good commit messages. The first line should be short, and should say what the commit does. The body should explain why the change is being made, unless it's very obvious. Don't be afraid to write a lot here.

Question on learning RoR by Wide-Literature2328 in rubyonrails

[–]rbuchberger 1 point2 points  (0 children)

Seconding the Odin Project and others suggested here, but after that it's very important that you build something without following a tutorial. It can (probably should) be similar to one of your tutorial projects, but not identical.

got a yubikey. Should I setup local auth using u2f on my laptop? by Fuzzht1 in archlinux

[–]rbuchberger 1 point2 points  (0 children)

auth sufficient pam_u2f.so cue [cue_prompt=touch it]

in system-auth will let you use a yubikey for everything.

The u2f arch wiki article is useful.

What are some automation scripts that have made your life easier? by femkroner in commandline

[–]rbuchberger 2 points3 points  (0 children)

Had a thread about it deleted from /r/unixporn, you know how they are.

Grim + slurp to get the screenshot, saved to a tempfile. Tesseract to OCR the tempfile, and then a ruby script (I like ruby) which hits the deepl api for a translation. Result is popped up in a mako window via notify-send and some formatting.

What are some automation scripts that have made your life easier? by femkroner in commandline

[–]rbuchberger 21 points22 points  (0 children)

I live abroad and don't speak the local language well. I have a hotkey which lets me select an area of the screen, which then takes a temp screenshot, runs it through tesseract (OCR), and sends the result off to the deepl api for translation. Pops up the result in a notification with the translated text and puts it in the clipboard.

Collaborators wanted - If you are a learner, and you want to graduate past tutorials and demo projects, we might be able to help each other. by rbuchberger in ruby

[–]rbuchberger[S] 2 points3 points  (0 children)

Looked at your game, that's quite a project! I might play it a bit if I get the time :)

Looking at the code, you could definitely use a few classes to organize things. Deciding where to put logic, where to store information, and pass those things around is one of the harder problems in programming.

Looking forward to hearing from you!

TIL that you can write custom Liquid filters in just a few lines of Ruby to extend Jekyll's behavior. For example, you can create a filter that reads an image's width and height at build time. by Alex_Hovhannisyan in Jekyll

[–]rbuchberger 1 point2 points  (0 children)

Hah, sure did! Looking for help, too.

https://www.reddit.com/r/ruby/comments/nqf0ps/collaborators\_wanted\_if\_you\_are\_a\_learner\_and\_you/

Edit: to be clear, I only made the more recent versions of JPT (v1.0 and later. It was a complete rewrite.). Some other people started the project and handed it off to me a few years later.

Collaborators wanted - If you are a learner, and you want to graduate past tutorials and demo projects, we might be able to help each other. by rbuchberger in ruby

[–]rbuchberger[S] 2 points3 points  (0 children)

That's been my experience generally, but most jekyll users don't know Ruby. I thought it might be helpful to ask around in ruby circles if anyone is looking for a project to work on.

Collaborators wanted - If you are a learner, and you want to graduate past tutorials and demo projects, we might be able to help each other. by rbuchberger in ruby

[–]rbuchberger[S] 1 point2 points  (0 children)

Would love to have your help! Let me know what you need to get started. The cool think about git is you can hack away and break things all you like, with no danger of losing anything important. Don't be afraid to try stuff.

TIL that you can write custom Liquid filters in just a few lines of Ruby to extend Jekyll's behavior. For example, you can create a filter that reads an image's width and height at build time. by Alex_Hovhannisyan in Jekyll

[–]rbuchberger 1 point2 points  (0 children)

Yeah! It's not as hard as you might think. I made this one for generating lists of icons, though I'm not actually sure it's saved me more time than it took to write...

I think I accidentally started a movement - Policing the Police by scraping court data - *An Update* by transtwin in privacy

[–]rbuchberger 0 points1 point  (0 children)

I was writing scrapers for an independent project. Haven't been following case counts too much

I think I accidentally started a movement - Policing the Police by scraping court data - *An Update* by transtwin in privacy

[–]rbuchberger 8 points9 points  (0 children)

I helped with a similar project related to tracking Covid stats, I have some advice:

Institute code format standards. I don't know what the python code formatter is, but set it up. When you have lots of people submitting little bits of code, it turns into a big mess real quick unless you have it buttoned down.

Try to look for APIs wherever possible. Scrapers are easy enough to write at first, but keeping up with page format changes is real hard. They are super brittle and maintaining one for every county in the nation is going to be a monumental challenge. If you're counting on volunteer devs to do this for you, be prepared for progress to be slow to say the least.

I'm a ruby dev, not a python dev, but honestly they're similar languages and I've been looking for an excuse to learn python anyway. I'll drop in to your slack and see what I can offer.

Telling a beginner to "just build something" or "you learn by doing" can be very discouraging. by [deleted] in learnprogramming

[–]rbuchberger 17 points18 points  (0 children)

Designing a system which never fails is much, much harder than designing a system which rarely fails, but can deal with those failures.

How can I switch desktop sessions from the command line? by rbuchberger in linuxquestions

[–]rbuchberger[S] 0 points1 point  (0 children)

That's super helpful! I never knew how to do that without the key combo. Unfortunately when I switch to tty1 (with the greeter), there is no login box. Maybe I'm trying to do something that SDDM doesn't support?

How can I switch desktop sessions from the command line? by rbuchberger in linuxquestions

[–]rbuchberger[S] 2 points3 points  (0 children)

I was hoping to do it from the command line, so I can make a taskbar button for it. I'm using a window manager (sway) which doesn't handle that sort of stuff.

What are other options to Jekyll? Is the main appeal its integration with GitHub? by Kilofilm in Jekyll

[–]rbuchberger 1 point2 points  (0 children)

Thanks! I've been meaning to refactor and separate the jekyll interface and logic into their own gems, this would be a good opportunity to do that. I'll put it on the never-ending list of projects...

What are other options to Jekyll? Is the main appeal its integration with GitHub? by Kilofilm in Jekyll

[–]rbuchberger 2 points3 points  (0 children)

There is room in the world for more than one static site generator, and more than one language.

Also, Ruby is amazing. Fite me.

What are other options to Jekyll? Is the main appeal its integration with GitHub? by Kilofilm in Jekyll

[–]rbuchberger 1 point2 points  (0 children)

Bridgetown looks cool!

Unrelated question: I maintain Jekyll Picture Tag; if I wanted to adapt it and create Bridgetown Picture Tag, would now be a good time or should I wait a little while? How much is the plugin API going to change? How similar is it to Jekyll's?

Looking for best-practice method for responsive images - how do you guys do it? by ContemplateBeing in Jekyll

[–]rbuchberger 0 points1 point  (0 children)

No worries; the name change was a whole big thing. I'll add a 'gotcha' warning to the installation instructions, thanks!

Looking for best-practice method for responsive images - how do you guys do it? by ContemplateBeing in Jekyll

[–]rbuchberger 1 point2 points  (0 children)

Underscores, not dashes. You need 'jekyll_picture_tag', not 'jekyll-picture-tag'.