This file contains 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' | |
def auth_header(path: nil, method: 'get', body: nil) | |
date = Time.zone.now.httpdate | |
# ORDERED list of headers in request to be signed | |
auth_headers = 'host date' | |
if ['put', 'post'].include? method.downcase |
This file contains 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
<?php | |
function intOrDouble( $str ) { | |
if ( is_numeric( $str ) ) { | |
if ( strpos($str, ".") !== false ) { | |
return 1; | |
} else { |