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
defp get_all_results() do | |
initial_url = "www.somewebsite.com/api/somerequest/someitems?limit=50" | |
get_results(initial_url) | |
end | |
def get_results(nil, accumulated_results \\ []) do | |
# No next URL, return the accumulated results so far | |
{:ok, accumulated_results} | |
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
defp get_all_results() do | |
initial_url = "www.somewebsite.com/api/somerequest/someitems?limit=50" | |
get_results(initial_url) | |
end | |
def get_results(initial_url) do | |
Stream.unfold(initial_url, fn | |
nil -> | |
nil |
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
def get_shopify_products_cursor_based(project_id, api_token, store_name) do | |
base_url = "www.derp.com/some_listing?limit=50" | |
results = | |
Stream.unfold(base_url, fn | |
nil -> | |
nil | |
acc -> | |
response = HTTPoison.get(acc, [], []) |
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
hi |
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
APP="your_app_name" | |
BUILD_HOST="your_aws_ec2_staging_machine_ip" | |
BUILD_USER="ubuntu" | |
BUILD_AT="/opt/your_app_name/builds" | |
STAGING_HOSTS="your_aws_ec2_staging_machine_ip" | |
STAGING_USER="ubuntu" | |
DELIVER_TO="/opt/your_app_name/api" |
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
# .circleci/config.yml | |
defaults: &defaults | |
parallelism: 1 # run only one instance of this job in parallel | |
working_directory: ~/app # directory where steps will run | |
docker: # run the steps with Docker | |
- image: circleci/elixir:1.7.3 # ...with this image as the primary container; this is where all `steps` will run | |
environment: # environment variables for primary container | |
MIX_ENV: test |
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
# .circleci/config.yml | |
defaults: &defaults | |
parallelism: 1 # run only one instance of this job in parallel | |
working_directory: ~/app # directory where steps will run | |
docker: # run the steps with Docker | |
- image: circleci/elixir:1.7.3 # ...with this image as the primary container; this is where all `steps` will run | |
environment: # environment variables for primary container | |
MIX_ENV: test |
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
checkout master | |
git pull | |
mix deps.get | |
mix compile | |
mix test |
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
checkout master | |
git pull | |
mix deps.get | |
mix compile | |
mix test |
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
GIT_REVISION_HASH=$(git rev-parse HEAD) | |
GIT_USER=$(git config user.name) # Get username from your console | |
function migrate_start () { | |
echo " :: Migrate PRODUCTION database" | |
mix edeliver start production | |
if [ $? -eq 0 ]; then | |
echo " :: Start PRODUCTION server" |
NewerOlder