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 map; | |
| var timer; | |
| function initMap() { | |
| var mapOptions = { | |
| center: new google.maps.LatLng(51.51121389999999, -0.1198244), | |
| zoom: 12, | |
| mapTypeId: google.maps.MapTypeId.ROADMAP | |
| }; | |
| map = new google.maps.Map($("#map-canvas")[0], mapOptions); |
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
| $(document).ready(function() { | |
| //$('body').on('change', '#search', function () { | |
| $('#search').change(function() { | |
| var _this = this; | |
| var searchTerm = $(this).val(); | |
| var results = _.filter(items, function(item) { | |
| var matchTerm = new RegExp(searchTerm); | |
| return item.name.match(matchTerm); |
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
| <html> | |
| <head> | |
| <title>Instagram Underscore Practice</title> | |
| <script src="underscore-min.js"></script> | |
| <script src="instafeed.min.js"></script> | |
| <script src="jquery-1.9.1.min.js"></script> | |
| </head> | |
| <body> | |
| <h1>My Amazing Timer Page</h1> |
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
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <div style="width:300px;height:300px;background:red" onmouseover="doStuff('green')" onmouseout="doStuff('red')" id="box"> | |
| </div> | |
| <script> | |
| function doStuff(colour) { |
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
| Animal.prototype = { | |
| constructor: Animal, | |
| name : "", | |
| numberOfLegs: undefined, | |
| speak : function() { | |
| console.log("Hello I am " + this.name); | |
| } | |
| }; | |
| function Animal(name, numberOfLegs) { |
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
| <% @authors = Author.all %> | |
| <ul> | |
| <% @authors.each do |a| %> | |
| <li><%= link_to a.name, url_for(:controller, :action, :author_name => 'M')%></li> | |
| <% end %> | |
| </ul> |
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
| Hello world |
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 File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb') | |
| require 'pry' | |
| class ProductsControllerTest < Test::Unit::TestCase | |
| context "ProductsController" do | |
| setup do | |
| @product = Product.new(:title => "Chocolate Teapot").save | |
| end | |
| should "return all Products when we visit /products" do | |
| get '/products' |
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' | |
| require 'rack/test' | |
| require_relative '../movie_server' | |
| class MovieServerTest < Test::Unit::TestCase | |
| include Rack::Test::Methods | |
| def app | |
| Sinatra::Application | |
| 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
| require 'sinatra' | |
| set :urls, { | |
| :xyz => "http://www.generalassemb.ly" | |
| } | |
| get '/:short_url' do | |
| full_url = settings.urls[params[:short_url].to_sym] | |
| if full_url | |
| redirect full_url |