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
// convert the ip address to a decimal | |
// assumes dotted decimal format for input | |
function convertIpToDecimal(ip) { | |
// a not-perfect regex for checking a valid ip address | |
// It checks for (1) 4 numbers between 0 and 3 digits each separated by dots (IPv4) | |
// or (2) 6 numbers between 0 and 3 digits each separated by dots (IPv6) | |
var ipAddressRegEx = /^(\d{0,3}\.){3}.(\d{0,3})$|^(\d{0,3}\.){5}.(\d{0,3})$/; | |
var valid = ipAddressRegEx.test(ip); | |
if (!valid) { | |
return false; |
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
# ... | |
desc "Deploy website to s3/cloudfront via aws-sdk" | |
task :s3_cloudfront => [:generate, :minify, :gzip, :compress_images] do | |
puts "==================================================" | |
puts " Deploying to Amazon S3 & CloudFront" | |
puts "==================================================" | |
# setup the aws_deploy_tools object | |
config = YAML::load( File.open("_config.yml")) |
NewerOlder