hacker

Gav Hern

@GavHern (81)
Hobbyist. I write in HTML, CSS, JS, Python, C#, C++, and a bit of Java; seeking to learn more.
h
GavHern (81)
Chrome Extension for Repl.it: Make a new repl from anywhere.
Hey, Everyone! I made a Google Chrome extension to quickly create new repls, no matter what page you're on! While I did initially make this for perso...
answered
h
GavHern (81)
JS: Least clunky way to dynamically append complex elements to the DOM?
I've explored several ways to add elements to the document with Javascript, but they all seem very clunky and unorganized... I'm trying to add compli...
h
GavHern (81)
[PHP] How to redirect all outgoing requests to a different address
I'm trying to make it so that, for example, if there is a link to `http://www.example.com` or an image linked to `http://www.example.com/logo.png`, I...
answered
h
GavHern (81)
Is there a way to remove the ".html" extension with .htaccess using repl.it?
I tried updating my site to use an `.htaccess` file to remove the `.html` file extension from the URL. This did not work and I'm just getting the repl...
answered
h
GavHern (81)
Is anyone else not able to save their code on repl..?
Whenever I make a change I get these two popups... ![image](https://storage.googleapis.com/replit/images/1572024191030_ecbe3754eab0e93b4ae27373e348f...
h
GavHern (81)
Coding Challenge! Make basic beginner code take up as little lines as possible
I was trying to do the Fibonacci sequence code in as little lines as I could and realized this could be an interesting challenge. Take simple beginner...
answered
h
GavHern (81)
Private Repls question
I just got hacker plan and I'm wondering something about private repls. If I have a repl that has a repl.co URL (like an HTML, PHP Web Server, thing...
answered
h
GavHern (81)
Best way to make a Windows compatible GUI?
I know a lot of languages for console apps but I want to expand to making actual applications with UIs and whatnot. My main goal is to make it look cl...
answered
h
GavHern (81)
How does fetching in javascript work.
I came accross this: ``` fetch('URL') .then(res => res.json()) .then((data) => console.log(data)) ``` and it works great! I just have no...
h
GavHern (81)
Keep nodejs repl always running?
I have a discord bot and i want to keep it always running... I have it on uptimerobot set to every 5 minutes but for some reason, my bot goes offline...
h
GavHern (81)
PHP - Make all requests to certain directory point to one PHP file
I know it makes more sense to do this in nodejs or something else, but my project is in PHP and I want to know if there's a way to do this in PHP. sa...
answered
h
GavHern (81)
How to use getElementById() in Javascript with tag name exception?
I have a bit of a tricky scenario. I want to select all of the children of and id `#navbar` that are `<a>` tags. I also don't want to select the child...
answered
h
GavHern (81)
How to make <button> inside <a> not follow the link src?
I'm making a friend's website and I have an `<a>` tag to link to a page about a game he's making. I also have a `<button>` inside that `<a>` tag to do...
h
GavHern (81)
How do you keep an element on-screen when the user navigates off the page?
I'm wondering how sites like Soundcloud are able to keep an element there no matter what page the user is on. (In Soundcloud's case, the audio player....
answered
h
GavHern (81)
How to get timestamp in javascript?
I'm trying to find how to get the current timestamp using javascript. Not the Unix Epoch timestamp (as in seconds elapsed since Jan 1, 1970) but a tim...
answered
h
GavHern (81)
How do python modules become importable without the .py file existing?
How do some libraries like `random` or `time` become "default"? Why is it that you don't need `time.py` or `random.py` in your project? Is it possible...
answered
h
GavHern (81)
Any way for a server to communicate to the client without the client requesting anything?
Say I wanted to make a text chat. Would there be a way that I could tell the frontend that there are new messages without the frontend having to conti...
h
GavHern (81)
Easiest way to work with date and time in PHP?
I'd like to be able to add a number of hours to a date. For example: `(1/15/2020 3:00PM) + 2 hours = (1/15/2020 5:00PM)` The issue I have is gettin...
h
GavHern (81)
How to make a translucent background without transparent color values.
On my website, I have a transparent color for my navigation bar background. ![image](https://storage.googleapis.com/replit/images/1567982403821_9b149...