Skip to content

Instantly share code, notes, and snippets.

View briochemc's full-sized avatar

Benoît Pasquier briochemc

View GitHub Profile
### A Pluto.jl notebook ###
# v0.11.14
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local el = $(esc(element))
@briochemc
briochemc / Makie_Chord.jl
Last active September 8, 2020 01:54
Use Pluto (reactive notebook) with Makie (plotting) to showcase the Chord method for Optimization
### A Pluto.jl notebook ###
# v0.11.12
using Markdown
using InteractiveUtils
# ╔═╡ 6b2d70e0-f0c0-11ea-11b1-452aa45f043d
using WGLMakie, AbstractPlotting, JSServe, Colors
# ╔═╡ ce3effa2-f0c1-11ea-1dc5-6fb4da9951c0
### A Pluto.jl notebook ###
# v0.11.12
using Markdown
using InteractiveUtils
# ╔═╡ acb74b48-edc4-11ea-12eb-d9193f5ab64f
using Plots
# ╔═╡ b2c05e44-edc4-11ea-356f-c1042b919836
@briochemc
briochemc / Gradients_AllHands_Aug2020_AIBECS.jl
Created August 31, 2020 07:49
This is a proof-of-concept Pluto notebook using AIBECS to run tiny simulations of a tracer forward and backwards in time, around the Gradients cruises. The goal is to provide a tool to investigate the movement/supply of nutrients.
### A Pluto.jl notebook ###
# v0.11.10
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local el = $(esc(element))
@briochemc
briochemc / nothing.jl
Created July 6, 2020 04:37
gifs for tuto
# Just trying stuff
@briochemc
briochemc / dancing_cubes.jl
Last active June 27, 2020 08:41 — forked from jkrumbiegel/dancing_cubes.jl
Dancing cubes
using AbstractPlotting
using MakieLayout
using GLMakie; GLMakie.activate!()
GLMakie.GLFW.WindowHint(GLMakie.GLFW.FLOATING, 1)
using LinearAlgebra
##
scene = Scene(center = false, raw = true, resolution = (800, 800))
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@briochemc
briochemc / Automatic-figure-sizing-1.svg
Last active April 24, 2020 14:21
svg files for ProPlot Julia examples
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Here is a curated list of various Julia tips and tricks to use with Julia's REPL interface. The nice colors (and some of the tricks) use OhMyREPL.

  1. Go to shell mode with ;

    shell

  2. Clear your screen with CTRL-L (or type ;clear)

clear

@briochemc
briochemc / covid19.jl
Last active April 2, 2020 06:37 — forked from mbauman/covid19.jl
using HTTP, CSV, Plots, DataFrames, Dates
# Download the data
df = CSV.read(IOBuffer(String(HTTP.get("https://covid.ourworldindata.org/data/total_cases.csv").body)), normalizenames=true)
# Plotting function
function doit(df, countries, alignment)
cp = get_color_palette(:auto, plot_color(:white), length(countries))
plot(legend=false)
for (i,country) in enumerate(countries)