Skip to content

Instantly share code, notes, and snippets.

View adamki's full-sized avatar
🤙

Adam Ki adamki

🤙
View GitHub Profile

Step One: Watch Writing Testable JavaScript - Rebecca Murphey from Full Frontal 2012 (award for worst conference name ever?)

Step Two: Fork this gist.

Step Three: Consider the four responsibilities that Rebecca lists for client side code (hint: they're color coded).

  • Did any of the responsibilities that she lists surprise you?

presentation & interaction data/server communication

@adamki
adamki / require.markdown
Last active February 9, 2016 20:41 — forked from rrgayhart/require.markdown
The Concept of Require

When you start working with WebPack for GameTime, you'll notice that you can't just define a variable in one file and find it in another as easily as you can in Rails.

Read Node.js, Require and Exports and Organize Your Code with RequireJS

Fork this gist and answer the following questions:

  • In the context of Node, what is a module? A module is a the essential building block of Node. In node, a module maps directl to a file. The contents of said file are still private and node requires that any access to the files' contents be explicetely returned.
**Step One**: Watch [Sorting Algorithms in JavaScript](https://www.youtube.com/watch?v=uRyqlhjXYQI)
**Step Two**: Fork this gist.
**Step Three**: Respond to this question in your fork: "What are some of the balances and trade offs between different sorting algoritms?"
Trying NOT to oversimplify this questions, but it is a balnace of Space and Time. Space refers to memory. Time refers to the amount time time consumed while performing a task.
Jenn describes how Big O is a variable that can be used to measure run time. While handy, this doesn't take into account when SPACE must be taken into consideration. We can use the example of a Space efficient sort (Bubble) contrasted with a time effecient sort(merge). Depending on the use case, and resources, one may choose a slightly slower sort to save space.

JavaScript Functions

I can explain the difference between function declarations and function expressions. yes

I can explain what the value of this is in a normal function. yes

I can explain what the value of this is when called from the context of an object. yes

Array Prototype Methods

I understand that functions in JavaScript can take any number of arguments. Yep.

I can describe the similarity between blocks in Ruby and anonymous functions in JavaScript. Yep. Anonymous functions are similar to Ruby Blocks.

Where are the methods available to all arrays (e.g. forEach, map, etc.) defined? Array.prototype.methods

@adamki
adamki / js-exercisms.md
Created January 30, 2016 09:32
Documenting my attempts at JS Exercisms.

Leap

my code here

  • Responder #1 here - This version took the same approach and minified it! Pretty clever. I kind of like my explicit returns. But this version is def more sleek.
  • Responder #2 here - Really cool implementaion of OOP JS. I dont actually understand everything going on here, but it looks easier on my eyes since is it following OOP guidelines.
  • Responder #3 here - Its David Daniel! Woot! Cool, clean and simple. Very close to mine, but he leaves out the explicit returns.
  • Responder #4 here - Its Tess Griffen! Cool. It's a bit verbose and really uses the if/else conditional blocks. But I like it. It is simple to read.

Hammin

# What is VIM? ( 15 minutes)
* What have you heard and what questions do you have?
* Is there any benefit to using VIM?
Endless customization, Terminal integration, Been around forever and not going anywhere. You'll never have to learn another IDE.
* How does it compare to Atom/Sublime?
Hard to say. Atom now has Vim mode, which is actually a pretty good IDE emulator. I prefer Atom/Subl for strict HTMLCSS writing occassionally.
* Pros: highly customizeable, Large community of users, become a hipster or something.
@adamki
adamki / gist:20bded28810675f9e7b3
Created December 8, 2015 18:24
Implementing Mandrill Email
Pre-Work:
Got to Mandrill and set up and account. Have your `username` and `keys` ready.
In Rails, run ` rails g mailer NotificationsMailer` (or something similar) will set up a new file in the `app/mailer/` folder. In this case it generates a `notifications_mailer.rb`. It also creates a new dir: `app/views/notifications`
1. Configure your Mail APP . In `config/application.rb` add the following configuration :
```
config.action_mailer.delivery_method = :smtp
@adamki
adamki / gist:cea50f99eb7ec8586056
Created December 8, 2015 18:24
Implementing Mandrill Email
Pre-Work:
Got to Mandrill and set up and account. Have your `username` and `keys` ready.
In Rails, run ` rails g mailer NotificationsMailer` (or something similar) will set up a new file in the `app/mailer/` folder. In this case it generates a `notifications_mailer.rb`. It also creates a new dir: `app/views/notifications`
1. Configure your Mail APP . In `config/application.rb` add the following configuration :
```
config.action_mailer.delivery_method = :smtp
@adamki
adamki / gist:4b0d5bf6fbf7974839ab
Last active November 17, 2015 17:53
demo and explain JS scopes!
# Javascript Scopes
Javascript scopes are pretty confusing if you come from a Ruby BG. Many times, I _thought_ that I was saving data to a variable or passing a specific value, but in all reality, I was passing around nil. I would like to demonstrate some of the *GOTCHAS* of Js.
EXAMPLE ONE: Variables have local and global scopes. They work like so:
```
var test = "I'm global";