« first day (3338 days earlier)      last day (1833 days later) » 

01:35
Well, Finally finished my snake game
its 100% canvas now
Oh, and I officially have 40 repositories now
01:52
Heres a link if you guys wanna test it out: skylerspark.github.io/Project-Snake-Javascript
I wanna make sure it works
just press the arrow keys to start, be careful, it is a tiny bit fast
i can't go in the opposite direction (up arrow then down array or left arrow then right arrow)
duh? you cant turn around opposite in the same block
that would be bypassing the game's rules
Ive been testing it, so far it runs fine
I got up to score 25 and then hit my snake's body
oof lag
I mean as a single block
you can go up than down with a single block
im still confused
when you start you have one block
02:02
oh wait I see
oh... well shit
actually, thatll be an easy fix
whole lot of latency
if only 1 cell, let d = down if up
etc
d = direction the block moves
x- y- x+ y+ etc
yeah and make it slow down a bit i think. Very difficult to turn on point.
thats because I dont know how to make it turn on a single block
wdym?
02:04
I can only make it turn , and then wait for the next frame, then it turns
so basically you have to turn RIGHT before the block you actually want to turn on
Why does this work || sometimes and not other times is it a node thing
Im sure using a double frame I could fix that
by making like... 1 interval going at 100 ms (actually going to slow that down) and another going at like 10 ms to detect arrow key changes, and effect direction based on that
well besides those couple issues
@ChristianMatthew || always works
does it atleast function correctly now?
what are you trying to do that it is not wroking?
@TaylorS wait. you are detecting key changes by using an interval?
02:07
no
the evnt listener detects for key changes, and then after every 100ms frame, it detects which direction you set it to (The event listener sets direction based on which key you press) and then after that frame, it moves that direction
not really sure how to fix that
why not move it when the arrow key is pressed?
02:30
@JBis it sometimes doesn't work in typescript. In my local env it works but when I deploy the undefined is always
codepen.io/SkylerSpark/pen/rNaVRRL Why do my rectangles in canvas blur on the edges, like big blurs
this doesnt normally happen
@TaylorS don't use CSS to size your canvas, it will just stretch it. Set the width/height properties. I recall reading once how you can use CSS to size it and then you have to do something in the JS to account for it, but I forget how that worked
cvs.width = cvs.style.width
nope
eh had to try
02:42
if you want your canvas to fill the window, you can do canvas.width = window.innerWidth
alrighty
I was just really bored and wanted to make an animated/canvas website that was really stupid
or...
an idea
set the width and height to 100% in the css
then, first thing in the js... canvas.width = canvas.clientWidth or something like that... lemme test with your fiddle
yeah, that works
nice
what about with the scrollbars
window innerWidth goes under the side and bottom and makes annoying horizontal and vertical scrollbars appear
lol guess Ill have to css them out
02:46
oh, set the body's margin to 0 if you haven't
oh!
no
set the canvas' display to block
alrighty
that did... nothing i guess?
dunno if it will work the same in codepen. Don't use that as your actual dev env
canvas is inline-block by default, which is affected by your document's line-height, which adds that tiny extra vertical spacing
I just set overflow hidden and did (cvs.width = window.innerWidth-2;) as it was going 2 pixels off the side of the screen for some reason
even with box sizing border box it was still off the screen .-.
the floor was doing the same thing
Wow this is actually a lot more adaptable and responsive than most HTML sites I make
 
5 hours later…
08:21
Hi! Hope everyone is feeling good today, a few more hours and it's the weekend :D
I have a question about my nodeJS Api and AWS S3, so my API allow the user to create and search for products in the database (which is a mongo), I wanted to integrate pictures with products so I used S3, but for now my AWS keys and all are in a .env file, how am I going to adapt this for users pls ? I'm realy new to API developpement and AWS Services so maybe it is obvious for you but not for me :/
yours aws keys should not be shared with users
add another method to your api that delivers a list pf urls to the pictures
save products and picture url in a db
this is what I already do, the user create a product with a picture and when he saves it the picture is sent to S3 and I get back the url of the picture which save in the products detail in the db
Then what you want is not clear to me
Ok sorry I'll try to make it clearer, let me think a little bit
08:30
Arent you using config files?
config files ? like what ?
I have a .env like I said with my AWS KEY and AWS SECRET KEY in it
thx i'll check that
1 message moved to Trash can
@NoOb Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
"s3BucketCredentials": {
  "bucket": "......",
  "accessKeyId": "..........",
  "secretAccessKey": "........",
  "s3URL": "https://s3.....",
  "folder": {
    "userProfileImages": "dev/user_profile"
  }
use something like this format in config file . and import them in your code from there.
08:35
So here is my question with more precisions, so if I take out my access key and the secret access key, how my application will post images to S3 ? I don't want everyone being able to post things, only private users you see ? How can I manage this ? How can I authenticate them in S3 ?
so while posting images ensure that the user is private . I think you will need your own authentication for that.
It depends how you keep private users.
@TaylorS its hard to play but nice work :P
Ok thank you i'll look into that :)
For the moment my application has no authentication system but it will be done later and i'll see how I manage the S3 then I think
should you not start with an auth system first?
@KarelG he is a noob in it..
he already admitted that he's new with AWS but that does not mean you aren't be able to prioritize some functionalities over others, no matter of the tech stack or platform
08:47
yeah thats right.
for the moment my developement is only in localhost use, that's why I did not make it a priority
it's not used by anyone, only me
Hey its fundamental to start with user auth first.. i think so..
Ok I didnt knew that :/
have a feature (that products) done -> have auth done -> needs to refactor feature

have auth impl done -> have a feature (that products) done
@oskll ^
if you work on features that relies on something else, ensure that the other feature(s) it is dependent on is ready to be used.
spares you hassle of refactoring in most of the time
TOPOLOGICAL SORT ;D
08:54
sure, you can prepare this or that, but planning is essential in IT development
Ok thanks a lot ! :)
I'm still a student, and never realy done API developement before, neither had courses about it, so I checked "how to do api with nodejs" tutorials and they all like do the routes, make it run, connect to a database, add some front and thats all
so I try to found more docuements how to make it better
I am at my desk at job
yeah similar
Debugging and reading code sucks
I am so bad at it.
Files are upto 16000 lines and ctrl+click sucks.
16k in a single file?
09:09
Yep
._.
I have a plastic axe here. Feel free to use it to those that contributed at that file.
Cant name the product .. otherwise :P
How in the hell do you have a 16k line file
@Kobe Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
thats backend on express
09:13
Oof
It's got to the point where rather than having 16k lines of code i have 16k files with like 20 lines of code
lol. It not that bad. It works.
It's nice cuz you can find everything by name
but then I've sorta got into css modules
then that's when its starts to get hard to find css that you want to change
cuz alot of classes are all the same name
Our backend is away from frontend
So angular repos are far away
Nice
I haven't really done any JS backend
I've used Laravel which was really nice to work with
Not a fan of Vue though
You poor, lost soul
Nothing about laravel is nice
09:26
Haha, how so?
lol
It's bloated and the routing is crap
It is bloated ngl
Lumen is semi-ok
I think it's pretty overkill for most of the stuff we do
I'd like to get into node
but I just haven't found the time
09:29
At least it's not cake 😃
Never seen cake
Is it another php framework
The cake is a lie
gotem
and the closest I've got to routing in JS is with react-router lmao
0 --- Laravel --- Lumen --- Yii --- 5 --- Zend --- 7 --- Symfony --- 10
my rating about PHP frameworks I worked on
symfony is great
Cake and CI must be < 0
09:42
CodeIgniter. LOL
already figured out that "CI"
but Cake?
I've never heard of cake before this lol
Is it well known?
> Faster. Stronger. Tastier
._.
Cringier lmao
@Kobe It's pretty popular, it's an old one
09:43
I see
the board must exist of some pastry lovers
 
2 hours later…
11:38
They loved pastry but came up with cake :D
let them eat pastry
our stripe webhook is not working . Anyone any ideas!
It works on stage but fails on live
11:53
I've developed an JVM in Javascript which is runnin on Browser
@neoexpert Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
@NoOb that's informative ...
i am on a knife edge
:O
there are two execution modes: 1: bytecode interpreting 2: ahead of time compilation to JS
@neoexpert how hard it is to implement?
12:00
@NoOb
@NoOb there are 201 bytecode instruuctions. You have to implement these. Before that you need to parse a class file where all the informations about a class are saved (fields, methods, etc)
@NoOb I don't use that service but check if there are no firewall problems (blocking?). the signature keys are correct, ect
analyze the statistics at strive and monitor traffic to the server
the advantage is: you can develop in an application in an IDE like Eclipse or intelliJ with powerfull features like refactoring
so the browser variant can beat Eclipse?
/s
You can run Java applications natively in the browser.
With nearly same speed like the native JS.
the JVM prints even the usual java stacktrace, when the application crashes
Well, and why would you run a java application on a webbrowser?
how do you receive/deliver the java archive?
12:11
@KarelG you can for example write an application which is running on Desktop Browser or Android.
^ @ShrekOverflow
The Application loads the classes and methods on demand.
Frequently used classes will be cached
I've also written some classes for DOM Manipulation and WebGL bindings
12:30
you are legend
12:45
Hi guys, my first time in the chatroom, i have background in PHP but just took JS serious recently (less than a year) with the MERN stack, still improving though, i don't have any solid project yet in JS except the basic CRUD, authenticatication and stuffs with express. I am planning to work on a product, its like a CRM, i aim to make it an SAAS, do you advice it to be done with JS backend or PHP?
@SodruldeenMustapha Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
Never php
@SodruldeenMustapha well, it depends
do you want it done quickly or do you want to use this opportunity to learn javascript?
I would encourage you to try to do something different than what you're used to.
also learn async/await and make good use of modules
@Neil, i can take as long as it takes, its also an opportunity to improve on my modern JS, but most importantly i aim to commercialize the product
@neoexpert that's cool
@SodruldeenMustapha there are many tutorials out there that will get you started
You should start with those, then go from there
@neil, thanks for that point you made, i have done same product for two companies that i have worked now, but all in PHP, i think i should try something new like you said
node.js is very adaptable
if I had any qualms about it, it's that it changes every week pretty much
The main APIs doesn't.
the issue i am facing is, i work with PHP in my daily job and do JS with few hours at home after work, i sincerely want to switch fully to backend JS from PHP but all the vacancies i have been seeing are always requesting for senior Full Stack JS, well i can work with react and redux but i see myself to be stronger with backend
12:56
no, most of the core features are pretty solid
take something you could do in under an hour using php, and try to write the same using javascript frontend and backend
it'll solidify a lot of things for you, and it'll boost your confidence using node.js
13:10
Yes, however node apps are designed differently than their php counterparts.
PHP is entirely file based while Node is routes based (with exception of public dir, assuiming you are using express or similar framework). Takes some getting used to if you haven't used another lang that uses this system.
yeah, you'll need to try to build it properly
I find it helps to keep the whole server aspect separate from the handling of the request
so it makes that part of it easily changeable
Yes, totally agree.
13:42
Would anyone like to review my JVM for JS project?
13:52
If its open source you can post github link
git clone https://gitlab.com/neoexpert/jvm
#you need maven to compile it:
mvn clean install&&
cd jsjvm&&
./run.sh
#open localhost:8080
gitlab? bleh
cool will take a look later
14:13
gitlab is gross
the gui makes me cringe in sadness compared to githubs
Its simple, dont get me wrong, but a git GUI with all the controls on the sidebar .-.
and it doesnt even have a clear destination, too cluttery
But github is owned by a bad company
So?
Looks better, works better, plus gist and github pages :>
and github desktop among all things
cant argue with that
> GitHub Desktop is a free and open source Git GUI client. It has an intuitive interface that allows you to manage code without you needing to type commands. You can make new or add local repositories and perform Git operations with ease.
as seen online
its considered the best of all the clients, even the web one too
.-. well honestly github desktop is the only desktop git client I know of, or have heard of
@neoexpert I thought that it would be javascript only ?
it is just a java ee container with vm and some browser code to interact with it.
The Server part does the parsing of classes. It could be also done on browser, but it would be a bit slower.
that's cheating :P
14:24
The Java program is running on browser. This is not cheating
it prints even stacktraces on crash directly in the browser console
Java exception stacktrace
Hi guys, I am using JS photoswipe and in IE 11 I get this error: i.ibb.co/8x58sVQ/ie11error.png . Chrome, FF and Opera are working fine. Unfortunately I need IE11 too. Can someone explain, how it comes to such an error?
I am planning also to write an compiler which compiles an set of classes to corresponding js classes
@neoexpert I expected it being able to run without using a server :)
@KarelG this could be done easily. you can just save the js sent from server as file. and it would run even without server
I meant that I write java code in browser and that it can be executed without any sending requests to a remote server
there is a dude here that wrote a win95 OS completely in javascript
14:30
I'll write the complier. It would do it than
15:21
What a waste
15:58
@KarelG I saw this but I don't understand how thats possible.
like how does it work
idk where to start if i wanted to do that
16:12
|| friday
16:48
Is it possible to update service worker with background sync? Today i received two push notifications from youtube saying "This website was updated in background"
90 minute MS Teams call on a really staticy connection. Holy fuck
 
3 hours later…
user10864482
20:17
darn. I'm required to use IE11 to debug. The browser is locked down; I can't modify shit in it. I have a web page popping an error. In the error message there is the function name. From console (f12) if I do theFunctionName.toString() nothing is shown.
user10864482
any idea why that would be?
How can I tell if a variable is not undefined if it could legitimately be null?
@human I am so sorry.
20:34
Is this possible?
            Object.defineProperty(this, 'parent', {
                parentCode: obj.parentCode,
                parentObj: undefined,
                get: function () {
                    if (typeof this.parentObj === 'undefined') {
                        var parentlist = vm.accountList.filter(a => a.accountCode == this.parentCode)[0];
                        if (parentlist.some())
                            this.parentObj = parentlist[0];
                        else
                            this.parentObj = null;
can the code inside the get function access the other variables in that block? this inside that block wants to refer to the object that Object.defineProperty() is in.
@human Why are you required to debug in IE11? Does it tell you file and line number? Can you go to it?
@Hypersapien My gut is that you can do that but I am not 100% sure. I suggest checking and seeing if you can. May i ask why you are trying to do it that way and not just have a method?
user10864482
21:03
because I'm in locked down environment
user10864482
I found the guilty; there is a active x and I guess that active x is spitting the error
user10864482
it tells me jack shit. god I hate Microsoft
user10864482
i can't even see the source code, only the dom
21:17
There's this beautiful freeing feeling when you ask the manager if you can disregard IE, and they tell you Yes.
that's like agreeing not to exchange xmas gifts
it's never completely 100% true
user10864482
@Hypersapien even when IE will retire I'm pretty sure they will keep it anyway
22:21

China is stealing American's data....again

4 mins ago, 2 minutes total – 8 messages, 1 user, 0 stars

Bookmarked 5 secs ago by JBis

second i saw that app i knew
user8729657
22:51
Dam
duh
why would they stop?
HAMMERTIME!
HAMMERTIME!
> At this point, as the saying goes, shame on us

« first day (3338 days earlier)      last day (1833 days later) »