r/javascript • • Jun 18 '17

Pass by reference !== pass by value

3.3k Upvotes

r/javascript • • Jan 29 '19

After learning JS more than a year ago and falling in love with React Native, this is my first project, Tour, a drag-drop trip planner.

2.9k Upvotes

r/javascript • • Jul 02 '19

Nobody talks about the real reason to use Tabs over Spaces

2.7k Upvotes

hello,

i've been slightly dismayed, that in every tabs-vs-spaces debate i can find on the web, nobody is talking about the accessibility consequences for the visually impaired

let me illustrate with a quick story, why i irrevocably turned from a spaces to tabs guy

  • i recently worked at a company that used tabs

  • i created a new repository, and thought i was being hip and modern, so i started to evangelize spaces for the 'consistency across environments'

  • i get approached by not one, but TWO coworkers who unfortunately are highly visually impaired,
    and each has a different visual impairment

    • one of them uses tab-width 1 because he uses such a gigantic font-size

    • the other uses tab-width 8 and a really wide monitor

    • these guys have serious problems using codebases with spaces, they have to convert, do their work, and then unconvert before committing

    • these guys are not just being fussy β€” it's almost surprising they can code at all, it's kind of sad to watch but also inspiring

  • at that moment, i instantaneously conceded β€” there's just no counter-argument that even comes close to outweighing the accessibility needs of valued coworkers

  • 'consistency across environments' is exactly the problem for these guys, they have different needs

  • just think of how rude and callous it would be to overrule these fellas needs for my precious "consistency when i post on stack overflow"

  • so what would you do, spaces people, if you were in charge? overrule their pleas?

from that moment onward, i couldn't imagine writing code in spaces under the presumption that "nobody with visual impairment will ever need to work with this code, probably", it's just a ridiculous way to think, especially in open-source

i'll admit though, it's a pain posting tabs online and it gets bloated out with an unsightly default 8 tab-width β€” however, can't we see clearly that this is a deficiency with websites like github and stackoverflow and reddit here, where viewers are not easily able to configure their own preferred viewing tab-width? websites and web-apps obviously have the ability to set their own tab width via css, and so ultimately, aren't we all making our codebases worse as a workaround for the deficiencies in these websites we enjoy? why are these code-viewing apps missing basic code-viewing features?

in the tabs-vs-spaces debate, i see people saying "tabs lets us customize our tab-width", as though we do this "for fun" β€” but this is about meeting the real needs of real people who have real impairments β€” how is this not seen as a simple cut-and-dry accessibility issue?

i don't find this argument in online debates, and wanted to post there here out in the blue as a feeler, before i start ranting like this to my next group of coworkers ;)

is there really any reason, in favor of spaces, that counter balances the negative consequences for the visually impaired?

cheers friends,

πŸ‘‹ Chase


r/javascript • • Mar 14 '17

solved! Can you help me allow my router to accept πŸ’© as the SSID?

2.4k Upvotes

I have a Xiaomi MI3 router flashed with Padavan (custom open source firmware). When I try to use an emoji or non standard characters in the SSID, a pop-up says: SSID cannot contain the character "πŸ’©"

I found what I believe to be the source of the message in ../www/general.js:

...

function validate_ssidchar(ch) {
if (ch >= 32 && ch <= 126)
    return true;
return false;
}

function validate_string_ssid(o) {
var i,c;
for (i = 0; i < o.value.length; ++i) {
    c = o.value.charCodeAt(i);
    if (!validate_ssidchar(c)) {
        alert("<#JS_validSSID1#> " + o.value.charAt(i) + " <#JS_validSSID2#>");
        o.value = "";
        o.focus();
        o.select();
        return false;
    }
}
return true;
}     

...

So to my non-javascript eye, it looks like it's checking if the SSID contains characters inside of the acceptable 32-126 ascii range, and denies if not, correct?

What would be the easiest way to get around this check? Can I block this bit using browser console or something?

If the only option is to edit the file and reflash the firmware, what should I change/remove exactly?


Edit: Hahaha why is this pinned as an announcement?

A lot of people have been asking for a ELI5 (mainly from the /r/bestof thread) so I made a video: https://www.youtube.com/watch?v=urH2ofav9us

TLDW;

  1. Go to router's admin page

  2. Change SSID to πŸ’©, get error message

  3. If on Chrome: Press F12 and click on the Sources tab

  4. On the left you should see a list of files with .js extensions.

  5. Click on ie. 'general.js', and search (ctrl+f) for 'SSID' or the text that appeared in the pop up that prevented you from using emoji SSID. What we need is something like function validate_ssidchar

  6. Click on the console tab, type validate_ssidchar (or whatever your router-specific function is), press enter, and see if it complains.

  7. Then simply reassign it by typing window.validate_ssidchar = function () { return true; };, press enter. (obviously change validate_ssidchar to yours.)

  8. πŸ’© should work normally now.


r/javascript • • Aug 04 '18

I built Apple Music using ReactJS, Redux, and Styled Components

1.4k Upvotes

r/javascript • • Jan 06 '18

I’m harvesting credit card numbers and passwords from your site. Here’s how.

Thumbnail
medium.com
1.3k Upvotes

r/javascript • • Jan 02 '21

Statistics for this post are updated real time in the comments.

Thumbnail
github.com
1.3k Upvotes

r/javascript • • Apr 17 '18

help Oracle Owns "Javascript", so Apple is taking down my app!

1.2k Upvotes

Just received this email from Apple about my app(Html, css, javascript snippet editor). Looks like you can't use "Javascript" because Oracle owns it!

Any one has any idea how to fight it or just give up?

"As you are likely aware, Oracle owns US Trademark Registration No. 2416017 for JAVASCRIPT. The seller of this iTunes app prominently displays JAVASCRIPT without authorization from our client. The unauthorized display of our client's intellectual property is likely to cause consumers encountering this app to mistakenly believe that it emanates from, or is provided under a license from, Oracle. Use of our client's trademark in such a manner constitutes trademark infringement in violation of the Lanham Act. 15 U.S.C. Β§ 1125(a)(1)(A). In order to prevent further consumer confusion and infringement of our client's intellectual property rights, we request that you immediately disable access to this app. We look forward to your confirmation that you have complied with this request."


r/javascript • • Sep 15 '20

Moment.js Throws in the Towel: "It is not dead, but it is indeed done."

Thumbnail momentjs.com
1.2k Upvotes

r/javascript • • Jan 26 '21

Google, Microsoft pitch in some spare change to keep Mozilla's Web Docs online bible alive

Thumbnail
theregister.com
1.2k Upvotes

r/javascript • • Jan 07 '19

Github private repositories are free now

Thumbnail
github.com
1.1k Upvotes

r/javascript • • Jul 10 '19

Someone posted a video showing off their pseudo desktop UI on r/webdev and I tried to make my version of it as a self challenge.

Thumbnail
gfycat.com
1.1k Upvotes

r/javascript • • Mar 16 '20

GitHub acquires NPM

Thumbnail
github.blog
1.1k Upvotes

absurd person dime edge gaze head terrific provide marble run

This post was mass deleted and anonymized with Redact


r/javascript • • Mar 06 '20

I made a discord bot for current coronavirus cases around the world!

1.1k Upvotes

r/javascript • • Dec 04 '25

In 1995, a Netscape employee wrote a hack in 10 days that now runs the Internet

Thumbnail
arstechnica.com
1.0k Upvotes

r/javascript • • Jan 31 '21

I created Deskreen. This is a free open source desktop app that makes any device with a web browser a second screen for your computer. Built with ElectronJS, React and other web technologies.

Thumbnail
github.com
1.0k Upvotes

r/javascript • • May 04 '19

Showoff Saturday A teacher at my school was sick of remembering all the different bell schedules, so I created an app to make things easier. The whole school loves it.

Thumbnail
classclock.app
1.0k Upvotes

r/javascript • • Nov 25 '15

Microsoft won't support IE8, IE9 and IE10 anymore after January 12, 2016

Thumbnail
microsoft.com
978 Upvotes

r/javascript • • Sep 05 '18

Water dynamics in my evolution simulator built in TypeScript / WebGL2

960 Upvotes

r/javascript • • Mar 19 '21

NASA's next generation mission control system is written in JavaScript, and it's open source.

Thumbnail
github.com
955 Upvotes

r/javascript • • May 13 '18

help Just got my first job as a programmer, being self taught and never had worked in a company I’m scared shitless but excited. Just wanted to thank this community which provided excellent resources.

954 Upvotes

r/javascript • • Jan 01 '21

Fellow humans, it is 2021-01-01T00:00:00+00:00.

948 Upvotes

Let us celebrate!


r/javascript • • Oct 03 '16

How it feels to learn Javascript in 2016

Thumbnail
medium.com
935 Upvotes

r/javascript • • Feb 13 '23

core-js maintainer: β€œSo, what’s next?”

Thumbnail
github.com
925 Upvotes