Skip to content

Instantly share code, notes, and snippets.

View robbielane's full-sized avatar

Robbie Lane robbielane

View GitHub Profile
blueprint:
name: Appliance has finished shaking
description: Do something when an appliance (like a washing machine or dishwasher)
has finished as detected by a vibration sensor.
domain: automation
input:
vibration_sensor:
name: Vibration Sensor
description: 'Vibration sensor entity (e.g. Aqara lumi.vibration.aq1
by LUMI vibration sensor). Needs to have device_class:
@robbielane
robbielane / recursion.markdown
Last active February 21, 2016 01:19 — forked from rrgayhart/recursion.markdown
Recursion and Generators Homework
  • Watch Recursion
  • Fork this gist
  • Answer the following questions in your fork
    • Do you pronounce 'babel' in the same way?
      • no
      • Follow Up Question: Will you now?
        • yes
    • What is an example of why/where you might use recursion
  • It is extremely useful when traversing any tree like structure.

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?

    • None of them are really surprising, however it's defining the different parts of the code is a powerful concept. It makes testing easier and more concise.
  • Do you feel like you mentally split your client side code in IdeaBox and other past projects into these responsibilities?

@robbielane
robbielane / require.markdown
Last active February 16, 2016 22:12 — 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 modular part of code that can be passed to different parts of your application.
**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?"
- insertion sort take very few lines of code to implement and is stable.
- bubble sort shouldn't be used. It uses unnecessary operations.
- merge sort is fast and stable, though it requires more lines of code.
**Step Four**: _Totally Optional_: take a look at some of the other forks and comment if the spirit moves you.

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.

  • Yes

I can describe the similarity between blocks in Ruby and anonymous functions in JavaScript.

  • Yes

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

  • Array.prototype
@robbielane
robbielane / setting_expectations.txt
Last active November 9, 2015 17:25 — forked from rwarbelow/setting_expectations.markdown
Setting Expectations
## Setting Group Expectations
Group Member Names:
1. When are group members available to work together? What hours can each group member work individually? Are there any personal time commitments that need to be discussed?
- Robbie has kids sometimes.
1. How will group members communicate? How often will communication happen, and how will open lines of communication be maintained?
-create a slack channel
-make phone number's available
@robbielane
robbielane / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console