Skip to content

Instantly share code, notes, and snippets.

View andersbjorkland's full-sized avatar

Anders Björkland andersbjorkland

View GitHub Profile
@andersbjorkland
andersbjorkland / traveling-salesman.livemd
Created April 10, 2024 16:08
Traveling Salesman Problem with Genetic Algorithm in Elixir/Livebook

Travelling Salesman

Mix.install([
  {:vega_lite, "~> 0.1.8"},
  {:kino_vega_lite, "~> 0.1.11"},
  {:jason, "~> 1.4"},
  {:kino_explorer, "~> 0.1.11"}
@andersbjorkland
andersbjorkland / genetic-algorithm.livemd
Created March 21, 2024 12:37
A Livebook document for a intro to Genetic Algorithms with Elixir

Genetic Algorithm as Module

Mix.install([
  {:kino, "~> 0.12.0"},
  {:kino_explorer, "~> 0.1.11"},
  {:vega_lite, "~> 0.1.6"},
  {:kino_vega_lite, "~> 0.1.10"},
@andersbjorkland
andersbjorkland / deployer.yml
Last active February 1, 2024 11:51
A Github Actions workflow configuration for using Deployer on a shared hosting service.
# Place your Github Actions workflow configurations in project_dir/.github/workflows/
#
# This configuration requires the following 4 repository secret variables:
# PRIVATE_KEY (which will contain the content of the private key for your repository. Either reuse the one from earlier, or better, make a new one.)
# KNOWN_HOSTS (contains a hash identifying the remote server as the genuine one. You will have the hash for the server in your local .ssh directory in the file known_hosts if you have connected to it before.)
# TARGET_HOST (the url for server when connecting with SSH. On one.com it has the form ssh.example.com)
# TARGET_USER (the SSH user for connecting to a remote server. On one.com the domain-name serves as the username, so it has the form of example.com).
#
# You are also required to update host_name for the SSH configuration on line 35 to match up with the host specified in your Deployer recipe.
@andersbjorkland
andersbjorkland / deploy.php
Created April 22, 2021 10:25
Example of a Deployer recipe for deploying to a shared host. It is assumed Deployer is a Composer dependency in the current project.
<?php
namespace Deployer;
require 'recipe/symfony4.php';
/*
* Run either 'deploy' (Symfony 4 apps) or 'mydeploy' (adjusted for shared host one.com).
* If running deployer as a project dependency on Windows you may need to run this:
* php vendor/deployer/deployer/bin/dep deploy
* instead of php vendor/bin/dep deploy