Skip to content
Sign UpLog In
Profile icon

Nikhil M.

@dfnk
Just coding because why not? https://dfnk.repl.co/
Repls
Community
dfnk
dfnk
shared a Post
2 years ago
discord.js and Heroku
I was hosting my discord bot on Heroku and after sometime it went down and said something about $PORT bind? Could I have some help on why this is not
RYANTADIPARTHI
RYANTADIPARTHI
hmm, if it shuts down, then that's their problem. maybe try it again, and if it does it again, host it somewhere else.2 years ago
AloeBest
AloeBest
Hosting it on Repl.it ensures it online 24/7 if done properly. I recommend moving it here.2 years ago
dfnk
dfnk
shared a Post
2 years ago
I was building a new website (I am using JWT) and I was wondering if someone comes to my site how can I automatically make them send the bearer token
Coder100
Coder100
I would do HTTP requests, like: POST /api-path { token: ... } `2 years ago
dfnk
dfnk
shared a Post
2 years ago
How could I find the id of a guild in discordjs when someone speaks in it?
Coder100
Coder100
Easy client.on('message', msg => { console.log('id', msg.guild.id) }) `2 years ago
dfnk
dfnk
shared a Post
2 years ago
How can I do document.querySelectorAll('section') in jQuery?
Coder100
Coder100
$("section") that's it! It will automatically change for all of the elements like: $('section').html("hi") `2 years ago
EpicGamer007
EpicGamer007
im not sure but im pretty sure you can do $("#your-div") to get it. it uses css accessors to access dom elements i think2 years ago
dfnk
dfnk
shared a Post
2 years ago
How can I get a sections id in jquery, like: how can I get the id?
Pankak
Pankak
$( "#something" ).stuffhere `2 years ago
dfnk
dfnk
shared a Post
2 years ago
how can I save data in my express session? app.get('/', (req, res) => { req.session.save /* then some variable */ = 10; res.send('saved'); }); `
techde
techde
app.use(session({ token : yourtokenvalue, key : 'test', proxy : 'true', store : new MemcachedStore({ hosts: ['127.0.0.1:11211'], //this should be where your Memcached server is running secret: 'memcached-secret-key' // Optionally use transparent encryption for memcache session data }) })); Credits to:https://stackoverflow.com/questions/47200350/save-data-in-express-session2 years ago
dfnk
dfnk
shared a Post
2 years ago
is there a way for my app to tell when the tab has been closed?
Coder100
Coder100
window.addEventListener('beforeunload', function (e) { // Cancel the event e.preventDefault(); // If you prevent default behavior in Mozilla Firefox prompt will always be shown // Chrome requires returnValue to be set e.returnValue = ''; }); read more and more2 years ago
Coder100
Coder100
sure, js right?2 years ago
dfnk
dfnk
shared a Post
2 years ago
my repl intellisense is not working for Nodejs is anyone else experiencing this problem?
Coder100
Coder100
Try reloading, intellisense is buggy. Also, for some reason, in some files it doesn't show at all Report this to bugs! Justice for the js devs! Python is overrated2 years ago
Bookie0
Bookie0
hi, Screen Shot 2020-10-15 at 10.21.22 AM code intelligence should work in nodeJS, make sure its turned on: go to settings, scroll down a bit, make sure Code Intelligence is Turned On. Screen Shot 2020-10-15 at 10.21.47 AM if it still does not work, must be a bug, in that case you can report it here ;)2 years ago
RayhanADev
RayhanADev
This is probably just a small problem that should be fixed by reloading the page and/or clearing browser cache. Let me know how it goes!2 years ago
dfnk
dfnk
shared a Post
2 years ago
In discordjs how would I check if the bot has been mentioned?
Coder100
Coder100
yey node.js! ` = msg` (or whatever) ` = 39408320498930` (or whatever id) .mentions.includes() If you want to get all the mentions: .mentions.match(//g) `2 years ago
dfnk
dfnk
shared a Post
2 years ago
How do I make my html, css, js site refresh itself with a functions? Like document.refresh()?
Coder100
Coder100
only in JS: location.reload() read more2 years ago
littlepenguin
littlepenguin
I think you do .reload().2 years ago
dfnk
dfnk
shared a Post
3 years ago
How would I change a image into bytes, with html and javascript?
Bookie0
Bookie0
actually i found some sites (really Javascript): https://stackoverflow.com/questions/9258932/how-to-convert-image-to-byte-array-using-javascript-only-to-store-image-on-sql-s https://forums.asp.net/t/1726390.aspx?convert+image+to+byte+array+in+javascript3 years ago
Bookie0
Bookie0
hi, idk but this might help? https://stackoverflow.com/questions/3801275/how-to-convert-image-to-byte-array https://www.programcreek.com/2009/02/java-convert-image-to-byte-array-convert-byte-array-to-image/ https://www.tutorialspoint.com/How-to-convert-Image-to-Byte-Array-in-java hope this helps! =)3 years ago
dfnk
dfnk
shared a Post
3 years ago
What do you use a `` element in html?
dfnk
dfnk
@coderash @mwilki7 @SixBeeps Could you show me a example?3 years ago
mwilki7
mwilki7
They are mathematical equations to draw shapes. Since mathematical equations are independent of screen resolution, they'll look sharp in any aspect ratio. Pictures are dependent on screen resolution (since they are made up of pixels) so they'll become more blocky the more you zoom in. This is not the case for svg shapes.3 years ago
coderash
coderash
svg's are images that can be infinitely scalable and therefore are never blurry. Very useful for modern websites!3 years ago
dfnk
dfnk
shared a Post
3 years ago
I was wondering how I could make a Dockerfile with more that one FROM FROM node FROM nginx is there a way to make them both in my image not just ngin
dfnk
dfnk
shared a Post
3 years ago
I was trying an actions which would build my app using Webpack, though when I run it no build folder comes up. I was asking since when I directly use
dfnk
dfnk
shared a Post
3 years ago
How to I get a file from the users computer onto my web app?
SixBeeps
SixBeeps
Depends on what you're going for, but if you want to do things locally you can look at the tag.3 years ago
dfnk
dfnk
shared a Post
3 years ago
Why is this repl always saw we need to redo them?
dishes(normal)
Node.js
Coder100
Coder100
Try console.loging the randint on line 133 years ago
dfnk
dfnk
shared a Post
3 years ago
How would I become a moderator and content creator on repl.it?
enderbob23
enderbob23
To become a content creator, you have to make tutorials good enuogh for the repl.it team.9 months ago
Bookie0
Bookie0
I think you become content creator by writing good tutorials. For mod, I think you have to report a lot of people I heard (for a reason), be present on repl talk a lot, and be a contributor3 years ago
dfnk
dfnk
shared a Post
3 years ago
How would I get the length of a list in python I have recently forgotten =).
Aqtion
Aqtion
you just do something like this length = len(list_name) where length is the length of the list3 years ago
dfnk
dfnk
shared a Post
3 years ago
Hi, I was wondering how to import this I believe it is not working because node is not installed, how would I do that?
Node.js
HTML, CSS, JS
RohilPatel
RohilPatel
Nodejs needs to be the language. Repl isn't very friendly with that. This is simply your web browser on a website. Go to repl.it > create new repl > select languages > Node.js3 years ago
Scoder12
Scoder12
Hi, go to the languages page and select "NodeJS" instead. Or if you really want to use the browser research webpack.3 years ago
dfnk
dfnk
shared a Post
3 years ago
Pickle is a module in python that can save data locally! let's start by importing this module, import pickle: then lest make a variable x = 10. Now
dfnk
dfnk
@everyone the saver package is currently down 😢3 years ago
wjustin
wjustin
@dfnk is'wb'overwriting?3 years ago