Skip to main content
17 votes
Accepted

Blog site generator written in shell script

#! /bin/bash That's where it's located on your system. But for some folks it might be in /usr/bin or /usr/local/bin. When publishing a portable script, consider ...
J_H's user avatar
  • 42.3k
16 votes
Accepted

IP address detection code

IP Detection. You are confusing an IP address with an HTTP header, the latter being utterly unreliable. It is ridiculously simple to fake an HTTP header. There is an old cautionary tale by Anthony ...
Your Common Sense's user avatar
13 votes

Javascript Syntax-Highlighter for Java

There's a glaring problem with this: no user input validation. A basic test revealed this: Ah, but that's not Java you say? True, but what if some poor sod has a stray HTML tag in their docstring? ...
Mast's user avatar
  • 13.8k
11 votes
Accepted

Javascript Syntax-Highlighter for Java

For a beginner this looks like a great start! Below are some suggestions to clean things up and make things more consistent. It is a common convention for HTML to not contain spaces between attribute ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
11 votes

Blog site generator written in shell script

Consider writing this in a programming language I think that generating a static blog content is complex enough that you'd be much better off writing it in a programming language. Like Python. Check ...
janos's user avatar
  • 113k
10 votes

IP address detection code

Are there any problems in it or is it well-written? Well, it is not really written in a simple manner - it is very redundant. A commonly accepted principle is the Don't Repeat Yourself. principle. ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
8 votes
Accepted

Vue - It's the Royal Game of Ur

\$\color{red}{\textrm{warning: cheesy meme with bad pun below - if you don't like those, then please skip it...}}\ \$ Question responses Do I have too many / too few components? I am aiming to make ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
8 votes
Accepted

Make Stack Overflow Design Great Again

That's generally a really neat code you've got there. Here are my remarks, though: Applying styles and position of it in code Instead of applyCssToHTMLCollection()...
Przemek's user avatar
  • 1,232
8 votes
Accepted

Dynamically loading CSS files based on URL or URI in PHP

Most of questions you are asking are not fit for this site and your code does not work as intended but this is an interesting case to review The grave mistake Adding anything to your code just in case ...
Your Common Sense's user avatar
8 votes

Javascript Syntax-Highlighter for Java

Interpreting any source code language entirely by regular expression — which is to say, without actually parsing the code and building an understanding of it on a syntactic level — is notoriously ...
FeRD's user avatar
  • 263
8 votes
Accepted

Selecting elements from the DOM of a page

Don't implicitly create global variables for (i = 0; uses a global i. Always declare variables before using them - in modern ...
CertainPerformance's user avatar
8 votes
Accepted

Cargo truck travel management

Name what it is, not how it is implemented in C# - public class TableItem Trip private async void UpdateTable() UpdateTrips No random numbers @for (var i = 0; i < 7 operatingWeekDays ; i++) &...
radarbob's user avatar
  • 8,249
8 votes
Accepted

Library project - javascript

I was in the midst of writing an answer, but ggorlen beat me to it. I echo most of those recommendations. Some additional considerations: No need to nest the Book ...
Greg Burghardt's user avatar
7 votes

Showing "open" or "closed" based on the current time

The first bug is that you are misusing setInterval(). You should be passing a function, not the void result of the function, when calling ...
200_success's user avatar
7 votes
Accepted

Simple HTML website with JavaScript navbar

General disclaimer: You may notice that in one section I recommend not using something in this case, while in the next paragraph I show how you can improve the part I recommended not to use. I mainly ...
Sumurai8's user avatar
  • 2,655
7 votes
Accepted

Stack Overflow clone

General Feedback the package 'StackCanary' can follow Java standard naming. Ref: https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html You do not need to type Tag on ...
gtiwari333's user avatar
7 votes
Accepted

Flex panels in CSS and JS

It looks pretty good to me. I can only see a few things to consider: More precise propertyName check You have if(e.propertyName.includes('flex')) { because Safari ...
CertainPerformance's user avatar
7 votes
Accepted

Tic Tac Toe with only the 3 last moves

Functions should generally be actions, and should accurately advertise what they do. So randomPlayer should be called ...
ggorlen's user avatar
  • 4,197
6 votes
Accepted

Simple input class change with vanilla JS

Review The biggest critique about the Javascript I have is that collapsedInput could be declared with const because it doesn't ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
6 votes

Animated Calendar using HTML + CSS + JS

Variables Always use a variable declaration when first declaring your variable. If you don't your variable will be put into the global scope, which is almost never what you want. It also makes it more ...
Joshua Hall's user avatar
6 votes
Accepted

Animated Calendar using HTML + CSS + JS

Welcome to Code Review. The CSS looks quite good. I haven’t seen too many style sheets with color lightsalmon 😃. Below are some suggestions. Cache DOM references ”...
Sᴀᴍ Onᴇᴌᴀ's user avatar
6 votes
Accepted

Tic-Tac-Toe Game vanilla JS/CSS

As you are as you say "brand new" to coding this will be less like a review and more like some pointers and advice.. Some pointers Rather than define the functions as arrow functions within ...
Blindman67's user avatar
  • 22.9k
6 votes
Accepted

HTML Editor, Online HTML Editor with Real-Time Preview

First of all, a little disclaimer: I'm not a professional Web frontend developer, every single line of HTML, CSS and JavaScript that I've written was for personal projects. The following is my ...
Green 绿色's user avatar
6 votes

Event sourcing javascript implementation

Just some quick points: You really should format the code according to common practices. Your unusual formatting makes the code very difficult to read, which will limit the number of people willing to ...
RoToRa's user avatar
  • 11.6k
6 votes

Library project - javascript

Avoid pointless comments that just restate what the code clearly does: //array where the new book objects are stored const myLibrary = []; ...
ggorlen's user avatar
  • 4,197
6 votes
Accepted

My first web project; calculate the GCD and LCM of two numbers and save cookies

I would like to find a way to skip checking if i is prime when it doesn't divide either number Fortunately this is simple: you can just skip checking whether ...
user555045's user avatar
  • 12.4k
5 votes

Tooltip-overlay following the mouse pointer

I found this post and took your code and made some changes. I wanted to have a very small piece of javascript code that supported style-able tooltips. First, the way you were editing the CSS was to ...
Mike's user avatar
  • 51
5 votes
Accepted

On right click draw triangle to the canvas

General problems It is better to add events via addEventListener rather than in the HTML, this keeps the source code together making it easier to maintain. It also ...
Blindman67's user avatar
  • 22.9k
5 votes
Accepted

Colors for unvisted, visited and hovered/focused/active links

Your question My actual question is about 2nd and 3rd implementations. I don't sure which choose from them. Which is better? That might lead to some opinionated answers, especially because better is ...
Sᴀᴍ Onᴇᴌᴀ's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible