Skip to content

Instantly share code, notes, and snippets.

View MichaelrMentele's full-sized avatar
👨‍💻

Michael Mentele MichaelrMentele

👨‍💻
View GitHub Profile

Michael Mentele

michaelrmentele.com 23214 41st Ne Ln / Redmond, WA 98053
206 618 4282 / michaelrmentele@gmail.com

Summary

Former Associate Power Engineer at Fortune 100 embedded systems manufacturer/developer

@MichaelrMentele
MichaelrMentele / html_skeleton.html
Created April 23, 2016 18:30
skeleton for html file
<!doctype html>
<html lang="en-US">
<head>
<title></title>
<meta charset="UTF-8" />
</head>
<body>
</body>
</html>

Do You Really Know How Functions Work?

A function is pretty simple, right? It's just a reference to a block of code that get's executed when called...

Kind of, but not quite. You see, functions also remember scope and bind to that scope when called, even when the context has changed, they can remember their local context. This is called a closure.

Lexical Scope of Nested Functions

What happens in the following code?

> ![preview](https://github.com/MichaelrMentele/css-projects/blob/master/nodebots/nodebots_preview.png)

WTF Javascript!?

This was my initial reaction when introduced to prototypal inheritance. I was like, jeez, do you have to make it so awkward to instantiate objects? Why can't you just be like everyone else.

I feel vaguely guilty now, a little like that teacher who called young Einstein dumb. Turns out prototypal inheritance is awesome. Cue Highschool Musical and other stories of upsetting the status-quo.

So...

What is Prototypal Inheritance?

In a word it's delegation--not inheritance at all.

When I first learned about the DOM I was confused about how it was referred to as a 'thing' that could be accessed (false) and a representation of things (true). So, I thought I'd share this distinction.

What is the DOM?

The DOM is a way of representing a HTML document as a collection of objects. This collection is organized into a tree (nodes) based on how the HTML elements were nested. Everything is a node in the DOM. Each node contains, as properties, it's parent, siblings, and children nodes (among other properties).

It is important to note that the DOM is language agnostic. That is, it is a convention, with which any programming language can generate a tree of nodes that represents some mark up. Most commonly this is done with Javascript.

What does it look like really?

@MichaelrMentele
MichaelrMentele / bst.md
Last active July 26, 2016 02:30
tutorial in recursion

Recursion

I've often heard new programmers ask why recursion is so useful. My brother, a successful IOS developer still doesn't see the value in recursion (at least I gather from our conversations).

So, is recursion some pointless 'book' knowledge without practical use?

Not at all!

What is Recursion?

@MichaelrMentele
MichaelrMentele / lazyobjectsJS.md
Last active August 18, 2016 21:59
Lazy Objects in Javascript

Constructors

Constructors create objects in Javascript. In other languages like Ruby, or Python they are similar to classes in function.

A normal function definition in JS looks like:

    function myFunction() {}; // Semicolon optional ;)

Auto-Didactism: Part 1 — Principles

I want to write a bit about how I've approached learning and how to learn effectively. I don't claim to be the world's foremost expert in learning but I've generalized my process to things like:

  • Fortune 100 R&D Engineering at a global leader — (Resume)
  • Handwalking — Watch me do stairs HERE
  • Web Development — (Github)
  • Zero to Backflip in 3 hours
  • Guitar self-accompaniment for songs
  • West Coast Swing (Just started with the GF!)