Skip to content

Instantly share code, notes, and snippets.

Gaurav Ramesh ggauravr

Block or report user

Report or block ggauravr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ai.conundrum.md

The past few months have been a roller coaster ride for the field of Artificial Intelligence. The field that aims to marginally replicate human intelligence, has met the critical eye of many experts in the field of technology. With the likes of Stephen Hawking, Elon Musk and Mark Zuckerberg making statements about the inception of artificial intelligence in real life and its far fetched visions, the subject has to be a talk of the technology world. A few incidences in the research work carried out in various organizations like Facebook have also added to the ripples to the already unstable discussions of AI.

All these discussions have created a confusion in the minds of a few common people, about the field in general. These are the people who will be directly affected , if AI surfaces out in real life. As an enthusiast in the field, I felt the need to express my thoughts on the entire discussion. The ideas mentioned below are correct to my knowledge. In case of any discrepancy please feel

View gist:18628953b5474d95c001f57cd43c8ac1
ModuleParseError: Module parse failed: /Users/gramesh/Documents/projects/start-page-nodejs/restaurant-profile/src/components/button/index.js Unexpected token (6:4)
You may need an appropriate loader to handle this file type.
| export default function Button(props) {
| return (
| <button type='button' className={styles.button}>{props.children}</button>
| );
| }
babelrc
{
@ggauravr
ggauravr / array_iteration_thoughts.md
Last active May 3, 2018 — forked from ljharb/array_iteration_thoughts.md
Array iteration methods summarized
View array_iteration_thoughts.md

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and

@ggauravr
ggauravr / top-grossers-2015.js
Last active Feb 21, 2016
A list of top 100 grossers of 2015
View top-grossers-2015.js
var titleLinks = document.querySelectorAll('table a[href^="/movies/?id"]'),
titleArray = Array.prototype.slice.call(titleLinks),
titles = titleArray.map(function(link) {
return link.innerText + '@' + link.href;
});
// titles is an array like this:
// ["Star Wars: The Force Awakens@http://www.boxofficemojo.com/movies/?id=starwars7.htm",
// "Jurassic World@http://www.boxofficemojo.com/movies/?id=jurassicpark4.htm",
// "Avengers: Age of Ultron@http://www.boxofficemojo.com/movies/?id=avengers2.htm",
@ggauravr
ggauravr / popular-movies-2015-imdb.js
Last active Feb 21, 2016
Most Popular Hollywood Movies of 2015 from IMDb
View popular-movies-2015-imdb.js
View declared-typeof-kinda-hoisted-let.js
(function() {
'use strict';
let someVariable; // not even initialized to undefined, FTW !!
console.log(typeof someVariable); // ReferenceError
someVariable = "Defined";
})();
View declared-typeof-let.js
(function() {
'use strict';
console.log(typeof someVariable); // ReferenceError!
let someVariable = "Defined";
})();
View declared-typeof-hoisted-var.js
(function() {
'use strict';
var someVariable = undefined;
var anotherVariable = undefined;
console.log(typeof someVariable); // prints "undefined"
console.log(typeof anotherVariable); // also prints "undefined"
anotherVariable = "Defined";
View declared-typeof-var.js
(function() {
'use strict';
console.log(typeof someVariable); // prints "undefined"
console.log(typeof anotherVariable); // also prints "undefined"
var someVariable;
var anotherVariable = "Defined";
})();
@ggauravr
ggauravr / undeclared-typeof.js
Last active Jan 21, 2016
typeof with undeclared variable
View undeclared-typeof.js
(function() {
'use strict';
console.log(typeof someVariable); // prints "undefined"
})();
You can’t perform that action at this time.