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
| #Signing AWS Requests By Using Signature Version 4 | |
| #http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html | |
| require 'uri' | |
| require 'openssl' | |
| require 'net/http' | |
| require 'cgi' | |
| method = 'GET' | |
| service = 'iam' |
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
| defmodule Decrypt do | |
| @iv String.duplicate("0", 16) | |
| def unpad(data) do | |
| to_remove = :binary.last(data) | |
| :binary.part(data, 0, byte_size(data) - to_remove) | |
| end | |
| def decrypt(data, key) do |
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 modified_date_or_datetime(string, modifier) do | |
| date_match = Date.from_iso8601(string) | |
| iso_match = Timex.parse(string, "{ISO:Extended}") | |
| isoz_match = Timex.parse(string, "{ISO:Extended:Z}") | |
| case {:ok, x } do | |
| ^date_match -> "#{string}#{modifier}" | |
| ^iso_match -> string | |
| ^isoz_match -> string | |
| _ -> raise "Invalid ISO8601 date/datetime format provided: #{string}" |
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
| defmodule Repo.Migrations.AddCountEstimateFunction do | |
| use Ecto.Migration | |
| def up do | |
| create_function() | |
| end | |
| def down do | |
| drop_function() | |
| end |
OlderNewer