Here is a simple and robust way to check for the validity of an email address syntax directly in the browser. No need for crazy regular expressions.
e = document.createElement('input')
e.type = 'email'
// check some email addresses
e.value = 'hi@'Here is a simple and robust way to check for the validity of an email address syntax directly in the browser. No need for crazy regular expressions.
e = document.createElement('input')
e.type = 'email'
// check some email addresses
e.value = 'hi@'By the way, I'm available for tutoring and code review :)
new Promise?.then callback yet?](https://gist.github.com/joepie91/4c3a10629a4263a522e3bc4839a28c83#6-butYou're in luck because I'm less than sober and love helping people switch to The Great People's Operating System. There are a few things that are a bit weird coming out the gate that took me a while to realize so I'm going to try and explain the freedom you have when switching from closed source operating systems.
If you're not having fun as a CS major running Linux you're doing it wrong. You can put as much or as little effort into the OS and really you'll learn stuff about how your software works that you never though you would. I love this shit. It's why I cringe when I use anything else. It's a drug. If something is really bothering you ask around and there's usually a solution. If not there's a compromise. If not there's bug reports and contacting d
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <!-- google's material design colours from | |
| http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
| <!--reds--> | |
| <color name="md_red_50">#FFEBEE</color> | |
| <color name="md_red_100">#FFCDD2</color> | |
| <color name="md_red_200">#EF9A9A</color> |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| var Youtube = (function () { | |
| 'use strict'; | |
| var video, results; | |
| var getThumb = function (url, size) { | |
| if (url === null) { | |
| return ''; | |
| } | |
| size = (size === null) ? 'big' : size; |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs