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 lang="en"> | |
| <head> | |
| <style> | |
| .rotate { | |
| animation: rotate 0.75s linear infinite; | |
| transform-origin: center center; | |
| } | |
| @keyframes rotate { | |
| /* Uncomment the following line and the <circle> will spin as expected. */ | |
| /* 99% {} */ |
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
| export function buildResponse(statusCode, body, cors = true) { | |
| const result = { | |
| statusCode: statusCode || HTTP_STATUS.OK, | |
| }; | |
| if (cors) { | |
| result['headers'] = { | |
| 'Access-Control-Allow-Origin': '*', | |
| Accept: 'application/json', | |
| }; |
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
| // https://github.com/nodejs/io.js/blob/8be6060020cd2f18ec6c1a5c3a40eb07b8d0e455/lib/_http_server.js#L18 | |
| var HTTP_STATUS_CODE = { | |
| 100 : 'Continue', | |
| 101 : 'Switching Protocols', | |
| 102 : 'Processing', // RFC 2518, obsoleted by RFC 4918 | |
| 200 : 'OK', | |
| 201 : 'Created', | |
| 202 : 'Accepted', | |
| 203 : 'Non-Authoritative Information', |
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 'base64' | |
| require 'openssl' | |
| require 'securerandom' | |
| # Creates and interprets .NET RFC2898 version 0 encoded passwords. | |
| # Password format is Base64.strict_encode64(\0x0 + salt + subkey) | |
| def encode(str) | |
| Base64.strict_encode64(str) | |
| end |