Skip to content

Instantly share code, notes, and snippets.

@sellisd
sellisd / how_much_code_in_Rmd.sh
Created May 31, 2021
How much R code is in Rmd files
View how_much_code_in_Rmd.sh
python -m pip install git+https://github.com/sellisd/gitrepodb.git # install gitrepodb tool
# download the 100 top-starred R-language repositories from github
gitrepodb init
gitrepodb query --query "language:R,sort:stars-desc:archived=False" --head 100 --project Rmd
gitrepodb add --basepath ./r_repos
gitrepodb download --project Rmd
# count the total lines of R code
find ./ -name '*.R' |xargs wc -l # gives 198721 total
# count total lines of Rmd files
find ./ -name '*.Rmd' |xargs wc -l # 192270
@sellisd
sellisd / join_frequencies.sh
Created Apr 21, 2021
What types of joins are commonly used
View join_frequencies.sh
# install tool for cloning github repositories
python -m pip install git+https://github.com/sellisd/gitrepodb.git
# Clone top 20 (based on star-rating) SQL repositories
gitrepodb init
gitrepodb query --project SQL --query 'language:SQL,sort:stars-desc:archived=False' --head 20
gitrepodb add --basepath ~/data/
gitrepodb download --project SQL
find ~/data/ -name *.sql -exec grep 'JOIN' {} \;> join_types.dat
View jump walk. R
library(tidyverse)
a<-numeric(0)
bet<-10
points<-0
for(i in c(1:100) {
points <-sample(-1,1)*bet+points
a<-c(a,points)
}
@sellisd
sellisd / keybase.md
Created May 13, 2020
Android created Gist
View keybase.md

Keybase proof

I hereby claim:

  • I am sellisd on github.
  • I am sellisd (https://keybase.io/sellisd) on keybase.
  • I have a public key ASAG0oqNdAVzt4zQ63i8nsh39YfU_dZXQ6KDb-JGjZPFNQo

To claim this, I am signing this object:

@sellisd
sellisd / generic_SIR.ipynb
Last active Apr 6, 2020
a generic SIR model
View generic_SIR.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.