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' | |
| require 'webrick/https' | |
| set :server_settings, | |
| SSLEnable: true, | |
| SSLCertName: [['CN', WEBrick::Utils.getservername]] | |
| get '/' do | |
| 'https page' | |
| 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
| // http://azu.github.io/promises-book/ | |
| // https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Promise | |
| p = (name, num = 1) => { | |
| return new Promise((resolve, reject) => { | |
| console.log(`${Date.now()} - num=[${num}] name=[${name}]`); | |
| setTimeout(() => { | |
| console.log(`${Date.now()} - timeout: num=[${num}] name=[${name}]`) | |
| if (name) { |
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 catch(_) | |
| (rand * 10).to_i.odd? | |
| end | |
| def you (_) | |
| _.to_i.even? | |
| end | |
| me = 'me' | |
| can = (rand * 10) |