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
| function init() { | |
| var link = document.getElementById("foo"); | |
| link.addEventListener("click", function changeColor() { | |
| this.style.color = "burlywood"; | |
| }); | |
| } | |
| init(); |
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
| request('http://www.google.com', function(error, response, body) { | |
| console.log(body); | |
| }); | |
| console.log('Done!'); |
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
| response = Faraday.get 'http://www.google.com' | |
| puts response | |
| puts 'Done!' |
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
| =calc($property, $expression) | |
| #{$property}: -moz-calc(#{$expression}) | |
| #{$property}: -o-calc(#{$expression}) | |
| #{$property}: -webkit-calc(#{$expression}) | |
| #{$property}: calc(#{$expression}) |
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
| ######## | |
| # app.rb | |
| # | |
| require 'sinatra/base' | |
| require_relative 'helpers' | |
| require_relative 'routes/secrets' | |
| require_relative 'routes/sessions' |
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
| ######## | |
| # app.rb | |
| # | |
| require 'sinatra/base' | |
| class SimpleApp < Sinatra::Base | |
| set :root, File.dirname(__FILE__) |
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
| ########### | |
| # config.ru | |
| # | |
| require File.dirname(__FILE__) + '/app' | |
| run SimpleApp |
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
| ######## | |
| # app.rb | |
| # | |
| require 'sinatra/base' | |
| class SimpleApp < Sinatra::Base | |
| set :root, File.dirname(__FILE__) |
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
| ######## | |
| # app.rb | |
| # | |
| require 'sinatra' | |
| set :root, File.dirname(__FILE__) | |
| enable :sessions |
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
| // defining attr_accessor on singleton Class instance of Foo | |
| class Foo | |
| class << self | |
| attr_accessor :color | |
| end | |
| end | |
| // not threadsafe |