Skip to content

Instantly share code, notes, and snippets.

View andrie's full-sized avatar

Andrie de Vries andrie

View GitHub Profile
@andrie
andrie / 092323-26203-01.dmp
Created September 23, 2023 07:09
Windows BSOD minidump
************* Preparing the environment for Debugger Extensions Gallery repositories **************
ExtensionRepository : Implicit
UseExperimentalFeatureForNugetShare : true
AllowNugetExeUpdate : true
AllowNugetMSCredentialProviderInstall : true
AllowParallelInitializationOfLocalRepositories : true
-- Configuring repositories
----> Repository : LocalInstalled, Enabled: true
@andrie
andrie / app.py
Created August 22, 2023 10:51
Shiny for python app that filters data prior to display in grid.
import pandas # noqa: F401 (this line needed for Shinylive to load plotly.express)
import plotly.express as px
import plotly.graph_objs as go
from shinywidgets import output_widget, render_widget
from shiny import App
from shiny import experimental as x
from shiny import reactive, render, req, session, ui
@andrie
andrie / app.py
Created August 11, 2023 14:17
Reprex of pyshiny dataframe not selecting correct rows
import pandas # noqa: F401 (this line needed for Shinylive to load plotly.express)
import plotly.express as px
import plotly.graph_objs as go
from shinywidgets import output_widget, render_widget
from shiny import App
from shiny import experimental as x
from shiny import reactive, render, req, session, ui
@andrie
andrie / hilbert.R
Created July 17, 2023 10:23
Compute the hilbert curve using R
# compute hilbert curve
# inspired by https://logicgrimoire.wordpress.com/2020/06/19/how-to-draw-the-hilbert-curve-using-a-computer-program/
library(ggplot2)
library(dplyr)
library(magrittr)
# rotate matrix
rotate <- function(x, th = pi/2) {
x %*% matrix(c(cos(th), -sin(th), sin(th), cos(th)), ncol = 2, byrow = TRUE)
@andrie
andrie / hexagon.tsx
Created February 28, 2023 18:26
Motion-canvas: extending the `Line` class to implement a Polygon
import {makeScene2D} from '@motion-canvas/2d/lib/scenes';;
import {createRef} from '@motion-canvas/core/lib/utils';
import {all} from '@motion-canvas/core/lib/flow';
import {createSignal} from '@motion-canvas/core/lib/signals';
import {Polygon} from '../components/Polygon';
export default makeScene2D(function* (view) {
const myPoly = createRef<Polygon>();

Keybase proof

I hereby claim:

  • I am andrie on github.
  • I am apdevries (https://keybase.io/apdevries) on keybase.
  • I have a public key ASDOCA6xxvGsbQQS_v860hBzhtmtZ2Jf-sscY3X2a2kl5wo

To claim this, I am signing this object:

@andrie
andrie / strange_attractor.R
Created April 17, 2019 14:27
Plotting strange attractors using `datashader` with `reticulate`
# Original blog post
# https://fronkonstin.com/2019/01/10/rcpp-camaron-de-la-isla-and-the-beauty-of-maths/
# For this example to work, you must have a conda environment with the datashader library
# See http://datashader.org/getting_started/index.html#installation for installation instructions
library(Rcpp)
library(reticulate)
library(dplyr)
use_condaenv("datashader", required = TRUE)
@andrie
andrie / Can you keep a secret.R
Created July 29, 2017 21:36
Demo of `secret` package at UseR!2017
# load the package ----------------------------------------------------
# install.packages("secret")
library(secret)
library(magrittr)
# set up local user ---------------------------------------------------
@andrie
andrie / CRAN_pkg_segmented_model.R
Created April 27, 2016 15:53
Segmented regression model of CRAN packages
library(segmented)
library(Ecdat)
library(ggplot2)
data("CRANpackages")
str(CRANpackages)
CRANpackages$Version <- as.character(CRANpackages$Version)
CRANpackages <- rbind(CRANpackages,
data.frame(Version = "3.2",
@andrie
andrie / 0-miniCRAN-SQL-server.R
Last active September 20, 2017 11:42
Use miniCRAN to install packages on SQL Server
# Instructions for using miniCRAN to create a package repository for installing packages on SQL Server 2016
#
# 1. Create a local repository on a machine connected to the Internet
# 2. Copy the miniCRAN repository to the target machine
# 3. Install the packages on the target machine