Skip to content

Instantly share code, notes, and snippets.

Avatar

Benoit Pasquier briochemc

View GitHub Profile
@briochemc
briochemc / dancing_cubes.jl
Last active June 27, 2020 08:41 — forked from jkrumbiegel/dancing_cubes.jl
Dancing cubes
View dancing_cubes.jl
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))
@briochemc
briochemc / covid19.jl
Last active April 2, 2020 06:37 — forked from mbauman/covid19.jl
View 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)
View julia-climate.jl
using Luxor, Colors
function main(fname)
Drawing(600, 600, fname)
origin()
circle(O, 290, :clip)
sethue("white")
paint()
colors = [Luxor.julia_blue, Luxor.julia_red, Luxor.julia_green, Luxor.julia_purple]
View neighbors_matrix.py
NEIGHBORS_MAP = {
0: (0, 0, 0, 0, 1, 0, 1, 0, 0, 0),
1: (0, 0, 0, 0, 0, 0, 1, 0, 1, 0),
2: (0, 0, 0, 0, 0, 0, 0, 1, 0, 1),
3: (0, 0, 0, 0, 1, 0, 0, 0, 1, 0),
4: (1, 0, 0, 1, 0, 0, 0, 0, 0, 1),
5: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
6: (1, 1, 0, 0, 0, 0, 0, 1, 0, 0),
7: (0, 0, 1, 0, 0, 0, 1, 0, 0, 0),
8: (0, 1, 0, 1, 0, 0, 0, 0, 0 ,0),