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
Inst = Struct.new(:op, :a, :b) do | |
def comp | |
raise "Missing Operand: a" unless a | |
raise "Missing Operand: b" unless b | |
return a.to_i + b.to_i if op == '+' | |
return a.to_i - b.to_i if op == '-' | |
raise "Invalid Op: #{op}" | |
end | |
end |
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
// In order to automatically deploy our ApiStage from Cloudformation, our | |
// Deployment resource name needs to be unique. In order to achieve this, | |
// we are to create a preprocessor that will find the string "$TIMESTAMP$" | |
// and replace it with the system time. This will allow us to create a unique | |
// resource name. | |
const fs = require("fs") | |
const path = require("path") | |
const replacements = [ | |
{ input: /\$TIMESTAMP\$/g, output: Date.now().toString() } |