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
| puts "Text please: " | |
| text = gets.chomp | |
| words = text.split(" ") | |
| frequencies = Hash.new(0) | |
| words.each { |word| frequencies[word] += 1 } | |
| frequencies = frequencies.sort_by {|a, b| b } | |
| frequencies.reverse! |
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 'json' | |
| pets = File.open("file.json", "r") | |
| doc = "" | |
| pets.each do |line| | |
| doc << line | |
| end | |
| pets.close |
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 lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Weather</title> | |
| <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
| <script type="text/javascript" src="main.js"></script> | |
| </head> | |
| <body> |
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
Show hidden characters
| { | |
| "force_override": true, | |
| "size": 11 | |
| } |
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
| var $window = $(window) | |
| /* Restore scroll position */ | |
| window.scroll(0, localStorage.getItem('scrollPosition')|0) | |
| /* Save scroll position */ | |
| $window.scroll(function () { | |
| localStorage.setItem('scrollPosition', $window.scrollTop()) | |
| }) |
NewerOlder