This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def to_pancake(ingredients, pancake = []) | |
| ingredients.each do |ingredient| | |
| ingredient.is_a?(Array) ? to_pancake(ingredient, pancake) : pancake << ingredient | |
| end | |
| pancake | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // QUESTION: What is a closure in Javascript? | |
| // ANSWER: Javascript closures are inner functions | |
| // that refer to variables in their outer function | |
| // EXAMPLE: | |
| function whatNum () { | |
| var outerNum = 10; | |
| console.log('I am the outer function and I returned ' + outerNum) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class HashParser | |
| def initialize(hash) | |
| @hash = hash | |
| end | |
| def parse | |
| array = Array.new | |
| @hash.each_key do |key| | |
| if key.is_a?(Fixnum) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This mapping opens up a new tab in vim with a grid layout: | |
| map <s-tab> :tabnew<cr>:vsplit<cr>:split<cr>:wincmd l<cr>:split<cr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> | |
| var date = new Date(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "rules": { | |
| "users": { | |
| "$uid": { | |
| ".write": "auth !== null && auth.uid === $uid", | |
| ".read": "auth !== null && auth.uid === $uid" | |
| } | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| var userZipCode, | |
| startingUrl, | |
| customUrl; | |
| document.querySelector('#submitButton').addEventListener('click', function() { | |
| userZipCode = document.querySelector('#userZipCode').value; | |
| startingUrl = 'https://api.wunderground.com/api/152eccaad753eb4b/forecast10day/q/37207.json'; | |
| customUrl = startingUrl.replace('37207', userZipCode); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- first exercise --> | |
| <ul class="list" id="font"> | |
| <li >One</li> | |
| <li>Two</li> | |
| <li>Three</li> | |
| <ul> | |
| <li><a href="//google.com">Four</a></li> | |
| <li><img class="profile" src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xap1/v/t1.0-1/p320x320/10407377_1513146665609773_349423795913602248_n.jpg?oh=2b0a250e7e5c6fe24802bc86cd0f2fc0&oe=553D5781&__gda__=1428243844_9dfe36a5e35f033f59332b10b9d1b221">Five</a></li> | |
| </ul> |