Skip to content

Instantly share code, notes, and snippets.

@sellisd
sellisd / how_much_code_in_Rmd.sh
Created May 31, 2021 20:37
How much R code is in Rmd files
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 April 21, 2021 06:01
What types of joins are commonly used
# 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
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 20:07
Android created Gist

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 April 6, 2020 09:19
a generic SIR model
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
a<-c(1,2,3,4)
b<-c(1,2,3,4)
plot(a,b)