1. Post #3801
    Gold Member
    Svenskunganka's Avatar
    September 2011
    1,976 Posts
    i'm curious about what i should do for practice, really
    i did some basic courses on php and mysql but i don't know how to practice those to reach a professional level
    sorry if i can't explain it properly
    I have an idea for you, create a real-time image processing service, like if I request yoursite.com/resize?w=400&h=400&source=http://i.imgur.com/xey6Q3U.jpg it returns a 400x400px resized version of that image. You'll have to deal with lots of fun stuff like aspect ratios, formats and caching (as you don't want to process the same image twice, image processing is resource intensive). Good luck!
    Reply With Quote Edit / Delete Reply Windows 10 Chrome Sweden Show Events Useful Useful x 3 (list)

  2. Post #3802
    Cow Muffins's Avatar
    August 2009
    559 Posts
    i'm curious about what i should do for practice, really
    i did some basic courses on php and mysql but i don't know how to practice those to reach a professional level
    sorry if i can't explain it properly
    Make an API where you can grab the data from the blog posts as a JSON file. Then make a widget that populates its fields using the JSON file.
    Reply With Quote Edit / Delete Reply Windows 10 Chrome United States Show Events Useful Useful x 1 (list)

  3. Post #3803
    Do I look like I speak squirrel?
    relinquish's Avatar
    November 2010
    1,226 Posts
    i'm curious about what i should do for practice, really
    i did some basic courses on php and mysql but i don't know how to practice those to reach a professional level
    sorry if i can't explain it properly
    How about a full-featured forum just like Facepunch? With the features like being able to track who is reading current thread or check who is online now should take you a long way there.
    Reply With Quote Edit / Delete Reply Windows 10 Chrome Thailand Show Events Useful Useful x 1 (list)

  4. Post #3804
    provides mlp plot free of charge
    Oicani Gonzales's Avatar
    February 2011
    20,977 Posts
    those are all great ideas! gonna have to work hard to make them come to fruition, though! thanks, everyone!
    Reply With Quote Edit / Delete Reply Windows 10 Chrome Brazil Show Events Friendly Friendly x 3 (list)

  5. Post #3805
    Gold Member
    jung3o's Avatar
    October 2011
    2,622 Posts
    if you want to really impress people, you would want to learn about unit testing as well. I haven't followed php development for a bit, but for php, there is phpunit
    If you use laravel, laracast should have some basic videos about it. seems like laracast is down atm though rip https://twitter.com/laracasts

    I've been writing test cases for my systems programming class and its actually hell. But its so satisfying once you see the greens
    Reply With Quote Edit / Delete Reply Windows 10 Chrome United States Show Events Agree Agree x 1 (list)

  6. Post #3806
    Resident Beat Eater.

    August 2009
    9,098 Posts


    SVG's are cool. Everything scales to the width of the browser using native CSS. Apologies for things being a little microscopic due to the window size.

    EDIT: Actually, this is all just HTML and SASS. I'm gonna rewrite the JQuery stuff.

    Reply With Quote Edit / Delete Reply Windows 10 Chrome United States Show Events Artistic Artistic x 1 (list)

  7. Post #3807
    Gold Member
    mdeceiver79's Avatar
    March 2012
    6,981 Posts
    Regarding sessions/authentication for web sockets.

    I've been assuming that you only need to authenticate when the websocket to the client is first opened/connected and any subsequent messages thru that socket can be relied upon to be from that client - is this the case?

    Edited:


    SVG's are cool. Everything scales to the width of the browser using native CSS. Apologies for things being a little microscopic due to the window size.

    EDIT: Actually, this is all just HTML and SASS. I'm gonna rewrite the JQuery stuff.

    This looks really nice, how did you get things to scale vertically correctly with just css? Was it that padding-bottom:100% caveat thing?

  8. Post #3808
    Gold Member
    Svenskunganka's Avatar
    September 2011
    1,976 Posts
    Regarding sessions/authentication for web sockets.

    I've been assuming that you only need to authenticate when the websocket to the client is first opened/connected and any subsequent messages thru that socket can be relied upon to be from that client - is this the case?
    A websocket at first is exactly like a normal HTTP request, having the same HTTP headers plus a couple more that tells the web server that this connection wants to be upgraded to a persistent websocket connection. The server then does its preparations and will respond with a 101 Switching Protocols when ready. This is called the handshake phase and should only happen once during the lifetime of the connection. So yes, you only need to authenticate/validate a WebSocket connection once (in its lifetime).
    Reply With Quote Edit / Delete Reply Windows 10 Chrome Sweden Show Events Informative Informative x 1 (list)

  9. Post #3809
    Gold Member
    Anti Christ's Avatar
    December 2009
    3,428 Posts
    I've made a userscript for Facepunch as a sort of hobby project. I'm no professional by any means, but I'd like to know how my code looks. Would anyone mind taking a look and telling me where I've made mistakes, could improve, be more organized, and so on? So far I've only tested it on Chrome. I intend to test it on Firefox when I get home tonight.

    If any of you are interested, I host it on Github
    https://github.com/lordhomogay/FP-Fixer

  10. Post #3810
    _RJ_'s Avatar
    December 2010
    566 Posts
    those are all great ideas! gonna have to work hard to make them come to fruition, though! thanks, everyone!
    If it hasn't been said before, try to keep your scope small (e.g. don't make the be-all-end-all website for all communications across the globe). You wouldn't want your progress to come to a standstill because of being overwhelmed.

  11. Post #3811
    Resident Beat Eater.

    August 2009
    9,098 Posts
    Regarding sessions/authentication for web sockets.

    I've been assuming that you only need to authenticate when the websocket to the client is first opened/connected and any subsequent messages thru that socket can be relied upon to be from that client - is this the case?

    Edited:



    This looks really nice, how did you get things to scale vertically correctly with just css? Was it that padding-bottom:100% caveat thing?
    Nope. It's all percentages and vw units. :)
    Reply With Quote Edit / Delete Reply Windows 10 Chrome United States Show Events Winner Winner x 1 (list)

  12. Post #3812
    Yandere Princess
    Alice3173's Avatar
    April 2010
    10,764 Posts
    I've made a userscript for Facepunch as a sort of hobby project. I'm no professional by any means, but I'd like to know how my code looks. Would anyone mind taking a look and telling me where I've made mistakes, could improve, be more organized, and so on? So far I've only tested it on Chrome. I intend to test it on Firefox when I get home tonight.

    If any of you are interested, I host it on Github
    https://github.com/lordhomogay/FP-Fixer
    I haven't examined it thoroughly and I'm by no means an expert either but I have one recommendation based upon my own personal experience:
    Code:
    if (!localStorage.fpfInit) {
    	localStorage.setItem("fpfInit", "true");	localStorage.setItem("fpfNavbar", "true");
    	localStorage.setItem("fpfLogo", "true");	localStorage.setItem("fpfLogoutButton", "true");
    	localStorage.setItem("fpfNotablePosts", "true");	localStorage.setItem("fpfIgnoreLink", "true");
    	localStorage.setItem("fpfThreadTitleHighlight", "true");	localStorage.setItem("fpfEnhancedIgnore", "true");
    	localStorage.setItem("fpfResizeUserTitles", "true");	//localStorage.setItem("fpfProfileMessageDeleted", "true");	//this is a silly feature. why did i add it?
    	localStorage.setItem("fpfDoubleColumn", "true");	localStorage.setItem("fpfHighlightLast", "true");
    alert("FP Fixer initialized. Be sure to adjust the settings in the new navbar link."); }
    Rather than adding each item as a separate local storage entry I'd recommend storing each of these items into a settings object then using that as the basis for your local storage. It'll make it a little bit more complicated to setup initially but it'll be less of a pain later on if you add or remove settings.

    Also after another quick look it seems like you're using localStorage.getItem() in every spot you'd need access to this data. That seems kinda inefficient. This actually goes hand in hand with the above but it'd be better to load the local storage settings into an object when the page is loaded then just read the settings from that object when you need them.
    Reply With Quote Edit / Delete Reply Windows 10 Firefox United States Show Events Useful Useful x 1 (list)

  13. Post #3813
    Gold Member
    Anti Christ's Avatar
    December 2009
    3,428 Posts
    I haven't examined it thoroughly and I'm by no means an expert either but I have one recommendation based upon my own personal experience:
    Code:
    if (!localStorage.fpfInit) {
    	localStorage.setItem("fpfInit", "true");	localStorage.setItem("fpfNavbar", "true");
    	localStorage.setItem("fpfLogo", "true");	localStorage.setItem("fpfLogoutButton", "true");
    	localStorage.setItem("fpfNotablePosts", "true");	localStorage.setItem("fpfIgnoreLink", "true");
    	localStorage.setItem("fpfThreadTitleHighlight", "true");	localStorage.setItem("fpfEnhancedIgnore", "true");
    	localStorage.setItem("fpfResizeUserTitles", "true");	//localStorage.setItem("fpfProfileMessageDeleted", "true");	//this is a silly feature. why did i add it?
    	localStorage.setItem("fpfDoubleColumn", "true");	localStorage.setItem("fpfHighlightLast", "true");
    alert("FP Fixer initialized. Be sure to adjust the settings in the new navbar link."); }
    Rather than adding each item as a separate local storage entry I'd recommend storing each of these items into a settings object then using that as the basis for your local storage. It'll make it a little bit more complicated to setup initially but it'll be less of a pain later on if you add or remove settings.

    Also after another quick look it seems like you're using localStorage.getItem() in every spot you'd need access to this data. That seems kinda inefficient. This actually goes hand in hand with the above but it'd be better to load the local storage settings into an object when the page is loaded then just read the settings from that object when you need them.
    You were right! Thanks for the suggestion. It took quite a bit of testing and changing stuff around, but I just got it working and pushed the update my master branch. I genuinely appreciate it, because I think I've got a pretty good hang of objects now, and I won't forget about them.
    Thanks to you, I knocked my localStorage calls down from 22 to 3, and only 1 of those is called on every page load, while the remaining 2 will be rarely used. I'm genuinely very pleased with this, so thanks a ton.
    Reply With Quote Edit / Delete Reply Windows 10 Chrome United States Show Events Friendly Friendly x 4 (list)

  14. Post #3814
    Gold Member

    May 2010
    5,873 Posts
    Starting work implementing some new designs. New designer also happens to be a god.

    Reply With Quote Edit / Delete Reply Windows 10 Vivaldi United Kingdom Show Events Artistic Artistic x 2 (list)

  15. Post #3815
    Resident Beat Eater.

    August 2009
    9,098 Posts
    The cyan looks easier to read than the red, and I'm scratching my head wondering why.

  16. Post #3816
    provides mlp plot free of charge
    Oicani Gonzales's Avatar
    February 2011
    20,977 Posts
    Make an API where you can grab the data from the blog posts as a JSON file. Then make a widget that populates its fields using the JSON file.
    played with json a bit, didn't make an api for the blog though



    How about a full-featured forum just like Facepunch? With the features like being able to track who is reading current thread or check who is online now should take you a long way there.
    progress:

    https://streamable.com/q2h0n

    I have an idea for you, create a real-time image processing service, like if I request yoursite.com/resize?w=400&h=400&source=http://i.imgur.com/xey6Q3U.jpg it returns a 400x400px resized version of that image. You'll have to deal with lots of fun stuff like aspect ratios, formats and caching (as you don't want to process the same image twice, image processing is resource intensive). Good luck!
    you're next

    Edited:

    also made this to play with frontend:

    https://streamable.com/0n180

  17. Post #3817
    Yandere Princess
    Alice3173's Avatar
    April 2010
    10,764 Posts
    The cyan looks easier to read than the red, and I'm scratching my head wondering why.
    Probably because our eyes are much more sensitive to green than red. For a lot of people even contrasting colors can be somewhat difficult to make out on a red background, or at least more difficult than it is for most other colors.