Skip to content

Instantly share code, notes, and snippets.

View clauswilke's full-sized avatar

Claus Wilke clauswilke

View GitHub Profile
@clauswilke
clauswilke / degen-analysis.R
Created March 29, 2024 19:14
DEGEN token price chart
library(tidyverse)
library(cowplot)
# download historical data in csv format from here:
# https://www.coingecko.com/en/coins/degen-base/historical_data
data <- read_csv("degen-usd-max.csv")
make_date_number <- function(x) {
as.numeric(difftime(x, ymd_hms(data$snapped_at[1]), units="days"))
}
@clauswilke
clauswilke / followers.html
Last active January 17, 2024 15:51
Warpcast webscraping and selection of winner
<!DOCTYPE html>
<!-- saved from url=(0047)https://warpcast.com/~/channel/ai-art/followers -->
<html lang="en" class=""><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="icon" href="https://warpcast.com/favicon.png"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><meta name="description" content="A decentralized social network"><meta name="theme-color" content="#17101f" media="(prefers-color-scheme: dark)"><meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><link rel="apple-touch-icon" href="https://warpcast.com/logo192.png"><link rel="manifest" href="https://warpcast.com/manifest.json"><title>Users following /ai-art</title><link rel="preconnect" href="https://fonts.googleapis.com/"><link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin=""><link href=
@clauswilke
clauswilke / normal.R
Created March 7, 2022 03:41
Deterministically generated normal variates
# Deterministically generated normal variates, implemented here in R but more
# useful for GLSL programming.
library(ggplot2)
fract <- function(x) x - floor(x)
rand <- function(x) fract(3482954.234 * sin(24934.342 * x + 12394.32))
norm <- function(x) {
@clauswilke
clauswilke / message.txt
Last active February 26, 2022 19:24
Tezos profile verification
I am attesting that this GitHub handle clauswilke is linked to the Tezos account tz1XTr7d3FZ19KndZ1HX3iav8fqKeZwGx8bZ for tzprofiles
sig:edsigu1GvDvbQoaUf51om2PgLtFvWX3sirA4NcVs7jj2nNganXtuk6mKEZCHFm2gSvGCkXA3L4y6ZjsVyTdnACwqL6kmsa36bHx
@clauswilke
clauswilke / GLSL-Noise.md
Created January 16, 2022 22:56 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
	return mix(rand(fl), rand(fl + 1.0), fc);
}
@clauswilke
clauswilke / CFR.Rmd
Created March 17, 2020 02:57
COVID-19 Case Fatality Rate (CFR) by age
---
title: "COVID-19 Case Fatality Rate (CFR) by age"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
```
# Code for presentation at rstudio::conf2019
# Slides:
# https://docs.google.com/presentation/d/1zMuBSADaxdFnosOPWJNA10DaxGEheW6gDxqEPYAuado/edit?usp=sharing
# Setup -------------------------------------------------------------------
library(ggplot2)
library(gganimate)
library(ungeviz)
library(mgcv)
@clauswilke
clauswilke / contour_lines.cpp
Last active December 27, 2018 21:50
Contour lines and bands example for R, written in Rcpp
// This file implements the 2D isoline and isoband algorithms described
// here: https://en.wikipedia.org/wiki/Marching_squares
// Written by Claus O. Wilke
#include <Rcpp.h>
using namespace Rcpp;
#include <iostream>
#include <vector>
#include <utility> // for pair
library(tidyverse)
library(sf)
# Development version of colorspace is needed. Install via:
# install.packages("colorspace", repos = "http://R-Forge.R-project.org")
library(colorspace)
crs_goode <- "+proj=igh"
world_goode <- st_as_sf(rworldmap::getMap(resolution = "low")) %>%
---
title: "World maps"
output:
html_document:
df_print: paged
---
```{r echo = FALSE, message = FALSE}
library(tidyverse)
library(sf)