- On Windows
- On Mac: you already have it!
- On Linux
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
| The first ever Computer Science "Man of the Year"... | |
| ...had a PhD in mathematics from Yale, and was a professor of math. | |
| ...joined the Navy at age 37 to help with World War II. | |
| ...learned to program as one of the original programmers of the Mark 1 at Harvard, which was instrumental in | |
| completing the Manhatten project. | |
| ...became the Head of Software at the first computer-focused tech startup, which created the first popular |
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
| require 'rubygems' | |
| require 'linkedin' | |
| client = LinkedIn::Client.new('75abcxm123himom', 'NDwtffWomglylolV') | |
| request_token = client.request_token({}, :scope => "r_network") | |
| rtoken = request_token.token | |
| rsecret = request_token.secret |
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
| a = [1,2,3,4,4] | |
| def mode(a) | |
| h = {()} # what are these parentheses? | |
| a.length.times do |i| | |
| # Code block? | |
| end | |
| 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
| # some Ruby code here | |
| def method_being_worked_on | |
| # awesome code | |
| 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
| Squirrels 04/22 | |
| Foxes 05/13 | |
| Otters 06/03 | |
| Grasshoppers 06/24 | |
| Dragonflies 07/15 | |
| Nighthawks 08/05 | |
| Fireflies 08/26 | |
| Coyotes 09/16 | |
| Salamanders 10/07 |
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 fib_recursive(i, m = 0, n = 1, count = 0) | |
| return m if count == i | |
| fib_recursive(i, n, m+n, count+1) | |
| end | |
| def fib_iterative(i) | |
| m, n = 0, 1 | |
| i.times do | |
| m, n = n, m+n | |
| 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
| ############## views/products/_trending.html.erb ############### | |
| <% @products.each do |product| %> | |
| <div class="product"> | |
| <%= link_to (image_tag product.thumbnail), product %> | |
| <div class="product-overlay-details"> | |
| <%= product.name %>... | |
| </div> | |
| </div> | |
| <% 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
| array.each_with_index do |line, index| | |
| if line.match(/^<s>/i) | |
| start = index | |
| splits = line.scan(/<(?:s|c)>\s*/i).map(&:size) | |
| end | |
| # detect a line that's all dashes and spaces | |
| if line.match(/^[\- ]+$/) | |
| start = index | |
| # scan for dashes followed by a space |
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
| require 'test/unit' | |
| def score(*frames) | |
| score = roll_count = 0 | |
| rolls = frames.flatten | |
| frames.each do |frame| | |
| if sum(frame) == 10 | |
| score += sum(next_three(rolls, roll_count)) | |
| else | |
| score += sum(frame) |