Jonathan Roley
@jjroley
Follower of Jesus. Huge React fan 🔥⚛️🔥, learning Rails
NJ
10
Lichess TVWatch Lichess’ current TV game
I just learned about ReadableStreams, so this was made to practice that and typescript
301
13
10
6
bottle bashSmash bottles as fast as you can in this quick-thinking game made with p5.js
69
5
6
astrothedev Definitely haven't seen this before.
The resize function isn't scaleable but everything else looks great! 3 months ago
12
3
blogjjroley's sporadic blog
Blog post #3, 11/22/22
Sorry it's been so long. I actually had a blog post all written a couple weeks ago, but just as I was about to publish it, I hit esc and poof, it was gone. 😭 After being dealt such a crippling blow, it took me time to regain the needed motivation, courage, and stamina required to set about on that quest again. Finally though, I'm back at it 💪 👍
Ok, so what's new? Well, I'm continuing on my quest with learning rails, and I'm continuing to be amazed by it. Node had better watch out...
Here's a tutorial on how to create a chat app with rails. This chat app will have some cool features, such as creating, editing and deleting messages. Basically something that would be a little complicated using Nodejs.
Oh, and also, I'll do it without writing a single line of code.
Let's build the app. If you use replit, you can create a new rails repl and skip steps 1 and 2.
First run this to setup a new rails app.
rails new chat-app
After the app is setup, navigate into the new directory.
cd chat-app
Now, time to create the comments! Run this command
rails generate scaffold Comment username:string body:text
This is one of rails' many code boilerplate generator commands, and it basically just creates a bunch of files and sets up the database schema.
Next, migrate the database with this command:
rails db:migrate
It's time to view the results of our hard labor. Boot up the server.
rails server
It will launch on port 3000. If using replit, it will open automatically. The rails logo should appear. Navigate to /comments in the browser, and voila, there's the app! Congrats, you've just built a forum 🎉👏 Try creating, editing, and deleting comments and messing around. Try to break it. It's bulletproof :P
So that's pretty simple, but it's just a demonstration of how awesome rails is. Rails has tons of helper methods, so a lot of it is about "convention over configuration." There are many useful features, but you have to use them in the way that rails works. That includes naming conventions, and I don't mean "the preferred way of naming things," but, "you have to name it this way or it won't work." I know some people might not like that, but I think it's really helpful. I mean, who am I--a noob coder--to say that the conventional way of doing things is not good enough.
Cool stuff to check out
Feather Icons: https://feathericons.com/ this is an amazing set of icons that I stumbled upon. They are simple, clean, and look amazing. You can also change the line width, a feature that's not usually included in icon packs. And a reason I'm annoyed with the free version of font awesome.
Erik D. Kennedy's newsletter: Once when looking for an online UI/UX course, I came across this: https://learnui.design While I didn't buy the course, I did sign up for Erik's newsletter, and so far, they have been amazing! He shares tips that just make things look so much better (when I actually implement them). As someone who feels lost when trying to design a project, just knowing some clear "rules" about design really helps.
Now for some questions:
Are comments in code distracting or helpful to you?
Is CSS the most difficult part of programming?
I'll wrap it up tonight, thanks for reading!51
11
3
3
blogjjroley's sporadic blog
Blog post #2 - 10/28/22
Wow, days can slip by. It's been over a week and a half :)
I have been searching for inspiration for things to build. I used to love building games, and I have made quite a few of them, but now they seem to take too much effort, since I'm really bad at graphics. Drawing out all kinds of sprites is really a drag.
Recently I've been super pumped about the powers of fullstack development. I need to keep learning about nodejs, databases, api's and all that good old stuff, but in the past few days, I've started a new quest.
New tech I'm learning
I dove into learning ruby a few months ago, and got pretty comfortable with the syntax and just the nature of the language in general. It's a really cool language. There are so many shorthands and dev-friendly features that make it a lot of fun to use. I liked coding with it, but, not having practical reasons to use it, I dropped off learning it for a while. In the past few days, I have started to learn the rails framework--after brushing up on my rusty ruby knowledge with a few algorithm problems. Rails is really cool. The people who designed it went all out making it extremely simple to set up and get started. create-react-app takes probably a minute to set up, Nextjs is better at more like 15 seconds, but rails takes even less than that. You can generate all kinds of boilerplate from the command line, and helper function are everywhere. It comes with a database already set up, and migrating is a breeze. I still don't know much, but I'm really exited to keep learning, and I'll keep you posted.
So as for inspiration, I'll definitely try building some apps with rails soon. Give me project suggestions if you have any.51
11
3
3
blogjjroley's sporadic blog
Blog post #1 - 10/17/22
Welcome to the blog
I'm a horrible writer. It has always been my weakest point I think. Since I'm done with high school, I'm not leaning it anymore. So this is in part to get me some practice writing just because I need to lol.
Ok, on to the main content.
One of my quirks as a programmer
I am a super picky coder. I will spend hours trying to come up with an elegant solution to a problem, when I could just throw something together that would work. But if I can't think of a way to have a clear, concise way to write it out, I will just scrap it and try to come up with something better. Yeah, it wastes a lot of time, but I think it makes the code less prone to bugs, since I know there are no gaps or potential side-effects in the logic. If you relate to this (or don't at all), post in the comments.
New tech I'm learning
Writing backend code is a kinda new thing for me. When I first started, I had a hard time wrapping my mind around the difference between client and server. When I started using node.js I thought that each individual user who visited the repl would be running their own copy of the server. So when I started learning about websockets, they seemed like total magic. I built a live chess app, and my mind got fried trying to figure out how socket.io worked, connecting two different players and so on. When I realized that the server is an entirely separate thing from the code that runs in the browser, it totally changed the way I went about developing. Any similar experiences? Feel free to comment!
Anyway, I'll wrap up this first blog post. Have a great day and keep on learning.51
11
3
3
blogjjroley's sporadic blog
51
11
3
jjroley # Welcome to the blog
I'm a horrible writer. It has always been my weakest point I think. Since I'm done with high school, I'm not leaning it anymore. So this is in part to get me some practice writing just because I need to lol.
Ok, on to the main content.
### One of my quirks as a programmer
I am a super picky coder. I will spend hours trying to come up with an elegant solution to a problem, when I could just throw something together that would work. But if I can't think of a way to have a clear, concise way to write it out, I will just scrap it and try to come up with something better. Yeah, it wastes a lot of time, but I think it makes the code less prone to bugs, since I *know* there are no gaps or potential side-effects in the logic. If you relate to this (or don't at all), post in the comments.
### New tech I'm learning
Writing backend code is a kinda new thing for me. When I first started, I had a hard time wrapping my mind around the difference between client and server. When I started using node.js I thought that each individual user who visited the repl would be running their own copy of the server. So when I started learning about websockets, they seemed like total magic. I built a live chess app, and my mind got fried trying to figure out how socket.io worked, connecting two different players and so on. When I realized that the server is an entirely separate thing from the code that runs in the browser, it totally changed the way I went about developing. Any similar experiences? Feel free to comment!
Anyway, I'll wrap up this first blog post. Have a great day and keep on learning.5 months ago
jjroley Wow, days can slip by. It's been over a week and a half :)
I have been searching for inspiration for things to build. I used to love building games, and I have made quite a few of them, but now they seem to take too much effort, since I'm really bad at graphics. Drawing out all kinds of sprites is really a drag.
Recently I've been super pumped about the powers of fullstack development. I need to keep learning about nodejs, databases, api's and all that good old stuff, but in the past few days, I've started a new quest.
### New tech I'm learning
I dove into learning ruby a few months ago, and got pretty comfortable with the syntax and just the nature of the language in general. It's a really cool language. There are so many shorthands and dev-friendly features that make it a lot of fun to use. I liked coding with it, but, not having practical reasons to use it, I dropped off learning it for a while. In the past few days, I have started to learn the rails framework--after brushing up on my rusty ruby knowledge with a few algorithm problems. Rails is __really__ cool. The people who designed it went all out making it extremely simple to set up and get started. create-react-app takes probably a minute to set up, Nextjs is better at more like 15 seconds, but rails takes even less than that. You can generate all kinds of boilerplate from the command line, and helper function are everywhere. It comes with a database already set up, and migrating is a breeze. I still don't know much, but I'm really exited to keep learning, and I'll keep you posted.
So as for inspiration, I'll definitely try building some apps with rails soon. Give me project suggestions if you have any.5 months ago
5
3d carousel3D testimonial carousel using CSS. Gsap was used for animating it and gsap draggable for the dragging capabilities
44
1
5
5