Finding Max Date in One Line In JavaScript

Earlier this week, I found a very interesting way of calculating the maximum dates from a set of dates with only one line of code. It came from this Stack Overflow answer. Here is a slightly modified version:

var dates = [
  new Date("2011/06/25"),
  new Date("2011/06/28"),
  new Date("2011/06/27"),
  new Date("2011/06/26")

var maxDate = new Date(Math.max.apply(null, dates));
// Tue Jun 28 2011 00:00:00 GMT-0400 (EDT)

Your results may be slightly different based on your timezone. This can be fixed with Date.UTC, but the purpose of the above is to show the most readable instead of adaptable solution.

This works firstly because dates are converted to the number of millesconds since 1 January 1970 (UNIX Epoch) when doing numerical or comparison operations. So:

console.log(new Date("2011/06/25") - new Date("2011/06/24"));
// 86400000 one day
console.log(1000 * 60 * 60 * 24);
// 86400000 milleseconds in one day

Secondly, Math.max takes a set of arguments to find the maximum of. So apply has to be used to send an array as a set of arguments into Math.max instead of doing a normal call.

Github Location:

submitted by anonymous

The exercise asked me to write a function that returned the min of two arguments, so I wrote one that returned the min of an array!  Its still pretty simple but it made me feel clever, maths always made me feel clever in school and now this does too, and since you ran out of submissions

function min(arr) {
….if (!Array.isArray(arr) || arr.length==0)
….var lowest = arr[0];
….for (var i=1; i<arr.length; i++) {
……..if (arr[i] < lowest)
…………lowest = arr[i];
…..return lowest;

(the dots are for indentation cause I think tumblr removes spaces)


Watch The Founder of Girls Who Code Perfectly School Trevor Noah On Why Culture Makes Or Breaks Women In Tech

On The Daily Show with Trevor Noah guest Reshma Saujani, an Indian-American lawyer and politician, discussed the initiative to encourage young women and girls to pursue studies and careers the booming tech field, where they are falling behind. But there are two moments in a girl’s life where we can reverse the trend.

Gifs: The Daily Show/

Coding Masterpost

Hey buddies guess what??

I’ve brought you some awesome links that I have for learning how to code, computer science posts, and also various things about hacking. :p


The best free and paid classes on the web. This is my go to site for learning something new.

$40 a month but the courses are top tier. You might find a free trial from microsoft dev essentials…

Free MIT courses with video lectures, notes, and resources!!!

Perhaps the most famous site for learning how to code, this is must have for any aspiring computer scientist, web dev, or programmer. A smooth UI, dozens of courses, APIs, and fun quizzes if you decide to cough up a bit of money. $19 is crazy dirt cheap compared to some $200 courses out there on the web.

Dubbed by its creator as the social network for programmers, TNB is a hotbed of hundreds of video tutorials for programming and computer science, as well as other disciplines like cooking.

Another crazy important site for anyone serious about programming. You can find online terminals, IDEs, and tutorials for almost every popular language out there, from oCaml to lisp

Geared towards children, this is a good introudction to programming thinking and helps a younger audience get into the problem solving mindset.

For users with some coding experience, codewars offers hundreds of challenges in various languages and help them build up their skills. Perfect for intermediate to master programmers.

This site is a bit geared towards new coders, it’s still fun and helps a ton in developing confidence.

Random blog that discusses some concepts regarding computer science. Worth a read if you’re ever lost and wanna just reflect on something.

Both the old and new sites are still up and provide their services for learning IT skills.


What good is a programmer if they can’t make a good resume to show off their skills? With these helpful templates you can impress your potential employer.

I haven’t used this so be cautious. Has a lot of ebooks.

Web development cheat sheet.

Awesome intro to programming with links to projects.

Eli has a blog and also videos for various things.

CCIE book. Not sure if it’s open source. I’ll remove this link if requested.

pay money, learn to code. seems legit.

A forum for Python usrers! There are only a few sections but there are enough posts on here so if you haev a question, it might have already been asked.

Another sweet forum that covers multiple topics.

A really popular forum! Lots of languages and users, dozens of topics.

Another large forum, perfect for any use.

A freaking large factory of forums you will never find the same post twice.

Lots of forums, jobs, and helpful resources all geared towards game development.

The most famous one imo. Be wary friend, don’t let your CS teacher find this in your browser history.

Resources, forums, tutorials, blow yourself out here.

Has some training missions and other stuff. Helps you find projects to work on.

Put your skills to the test against AI or humans.

Like big data? Well this site teaches you Python, the numpy library, and R.

Full of courses for anything.

handy book on progrmaming.


This is one of the BEST websites to learn about security and you can follow tutorials by real hackers and members of the IT field. With a strong community full of experienced authors, you will either flourish by using proper grammar or be mocked for asking “how do i hack gmail??”



Small collection of resources for educating yourself on internet security.

A must read for anyone with a desire to get into IT

Crash course on Command line.

Great if you cannot afford pricy online classes. Instructors know what they are talking about and despite a few poor quality videos, you will be supplied with helpful resources and forums.

One of the better forums out there for learning. Delve into it at your own risk.

ROBLOX hacking, general exploits, or just normal discussions. Roblox helped put me on my path to coding and I love how every day, millions of kids are being taught the ability of coding thanks to its studio.

Lessons, challenges, forums, and resources all bundled in a site to hone your pentest skills.

Like hackthissite, but with a different UI

Read the above

Free pentest tools. Don’t use it for anything wrong.

Hehe..we are in defcon 4..

Capture the Flag learning site. Amazing imo.

Another war games site. You get various challenges that are fun to solve ^.^

Wikipedia but for security.


Compete against IT pros. Git rekt code-bug

Explore this site a bit.

The link kinda gives it away.

Fun little project.

Professional blog that has tutorials and highly detailed information.

Ahh read the above please!

A CTF guide. Pretty well written and has slides. Awesome resources. What else can I say?

Another swell blog.

Woa..another..awesome blog..there are too many to count!

Hey kid? Wanna learn how to hex edit like a b0ss?

Nice little pdf for forensics.

A blog that’s a bit dated but has useful information.

Dated but useful blog.

haven’t tried this yet but it has great reviews.

Search engine for data scientists.

Best sites to learn from.

Awww yiss ebooks

Might run into errors downloading books.

Full books that are virus free.

That’s all for now! Special thanks to everyone who suggested I make this!

So I was scrolling through SM’s EXO page coding html and let me tell u they have lots of things planned. This album might be in 4 languages or something if I’m reading this correctly, I keep seeing things like Album EN, Album JP, Album KR, Album ZH (I’m assuming this is Chinese.. zh….) 4x the money for 9x the members 36 versions? SM stop.

But also reading the back HTML of the page, no wonder it takes them forever to release something, all this coding must have been a serious pain. Bless u coding bro.

But I find cute things in their coding like for example 

I wonder if the coders send messages to each other but why are they sending it in English? I know HTML is usually done in English but if it’s behind a hidden section why bother? Either way, it’s cute.

In the HTML, there seems to be an explicit mention of a ‘teaser movie’ they left the URL space blank, so I can imagine something is going on behind the scenes soon to be revealed.

That’s all. 


Sticky Notes Tutorial

coded by yukoki & suggested by hyskoa-mourououu

A tutorial for how to add these sticky notes to your theme!! They’re draggable, you can add bold/italic/linked text, and you can close the sticky notes once per page refresh. This tutorial mainly involves a lot of copy-pasting, so it’s not too difficult. I don’t guarantee they’ll work on all blog themes because of conflicting scripts, though.

Keep reading

Computer science masterpost

Hey, guys. I’ve decided to make my first study masterpost. This contains great free online courses to improve your coding skills and broaden your knowledge or a guide for a newbie who wants to start learning cs. Many of this recommendations were sent to me by some big tech-companies to help me to prepare for the interviews. Generally, it would be a great addition to classes taken at college. 


Object-oriented Programming Languages

Discrete math

Algorithms and data structures

Operating systems 

Parallel programming

Computer Science sub-fields 



Interactive webtoy by David Li is a fun fluid dynamics simulator which lets you play around with various parameters - here is a video of it in action:

Fluid simulation is a GPU implementation of the FLIP method (with various additions). Particle rendering uses spherical ambient occlusion volumes. 

You can find out more and try it out for yourself here

Fix emojis on your blog

or replace them with better ones.

Ever wondered why emojis on your blog show up as Unicode from the desktop?

It’s because browser support for emoji rendering is still quite poor (like chrome on windows)

Mac users should support them usually, but you can replace them with better-looking ones.

This tutorial will add emoji support to your blog in a few lines of code.

Difficulty:  ●○○ (easy)

Keep reading

It’s summer, which means you probably have enough free time to do something for you. But sometimes you don’t want to just relax, watch your favorite tv show or read your favorite book. No, you want something more. You want to be productive and you want to show everyone that you are not a lazy studyblr owner (because everyone is clearly productive as hell).

Here is a little guide to sites, that will help you reach your goal and show everyone that you are the most productive of us.

(god, that sounded like a teleshopping ad)

CODECADEMY - If you want to learn to code, this is the site for you. From basics of HTML and CSS, to Java, Python or SQL. I used this to revise my html abilities and to teach myself some basics of SQL. It’s easy, it’s understandable and it’s fun. The best part? It’s free.

CODE SCHOOL- Also a site that helps you learn coding. This one is a little bit tricky. You only get access to 10 intro courses and then you have to pay (29$/mo is too much I think)

KHAN ACADEMY - You have heard of it, right? Math, science, economics, coding, history and many more in one site. You earn points as you watch videos/do the tasks and for the point you unlock a little cute characters for your avatar. You also have some test prep there, so if you want, you can check it out. Also, it’s free.

CRASH COURSE - We all know John Green. We also know that he is a youtuber. But did you know that he actually wants to teach you something? With his brother, he has this YT channel in which they teach things like physics, psychology, history, economics, biology and many more. I use it for econ, but I want to get into physics more, because I’ve had problems with it in school. The little - they have, that it’s fast. So fast that sometimes, if english is not your first language, you will have to pause it and jump back a little bit. I don’t have a problem with english at all, but this speed is like me in front of my class, trying to present something (okay, that was like 3 years ago, I learned how to slow down). DFTBA!

COURSERA - Courses from universities all over the world. Even Ivy League schools have their courses there. The courses are either self-paced, or start at some date and you have to meet the deadlines. I love the self-paced ones. Also, if you want a certificate of completition, you have to pay but, if you don’t care about that, it’s totally free. 

edX - Basically the second Coursera. Or is Coursera the second edX? Who knows.

DUOLINGO - Learn new languages or just keep practising the ones you already know. You probably knew about this one, right?

MEMRISE - A little bit different from duolingo. This site is great for vocabulary, but I don’t use it for anything else. But for revising and learning new words - this is the one to look for. Also, there is a SAT course with all the creepy words.

TED - This is not a site like any of the sites above. Here, you listen to some hella inspiring people that achieved something, and learn to look at things from a different angle. I love this, and you should too. Just find your topic, and enjoy.

BOOKBOON - FREE TEXTBOOKS! YAY! I use this when I want to download some books for econ/finance self-learning. I want to be prepared for my class next year (yay, I’m so excited to start econ classes). Really, go and check this out. You will love it.

I hope you will use this to fill your time with awesome things. If you know any other great sites, just add them to this list. 

With love,