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 'grape' | |
class API < Grape::API | |
prefix :api | |
version 'v1', using: :path | |
resources :users do | |
desc 'return all users' | |
get '/' do | |
puts 'Users' |
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 'ostruct' | |
require 'benchmark/ips' | |
class User | |
attr_accessor :name, :email | |
def initialize(attrs) | |
attrs.each { |key, val| send("#{key}=", val) } | |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<button onClick="clearCache()">Clear cache</button> | |
<button onClick="loadImages()">Load images</button> | |
<button onClick="cacheImages()">Cache images</button> |
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
{ | |
"reportRequests": [ | |
{ | |
"viewId": "YOUR_VIEW_ID_IS_HERE", | |
"dateRanges": [ | |
{ | |
"startDate": "2015-01-01", | |
"endDate": "2019-04-10" | |
} | |
], |