Skip to content

Instantly share code, notes, and snippets.

View sbalci's full-sized avatar
🔬
🔬👀📑🗃📊🏨🗄📇📖⚗📝🎶📈📉📃🖍🔬🔬🏋🏻‍♂🚴🏻‍♂🚙👨‍💻🤷‍♂📸📺🎛🔭🔬💊🔐🍫🌸

Serdar Balcı sbalci

🔬
🔬👀📑🗃📊🏨🗄📇📖⚗📝🎶📈📉📃🖍🔬🔬🏋🏻‍♂🚴🏻‍♂🚙👨‍💻🤷‍♂📸📺🎛🔭🔬💊🔐🍫🌸
View GitHub Profile
@sbalci
sbalci / crosstabs with tidyr and dplyr
Created September 26, 2018 15:34 — forked from trinker/crosstabs with tidyr and dplyr
crosstabs with tidyr and dplyr
if (!require("pacman")) install.packages("pacman")
pacman::p_load(dplyr, tidyr, wakefield)
set.seed(10)
dat <- r_data_frame(n = 10000,
race,
age,
sex
)
@sbalci
sbalci / gist:14faad0bbbefec41bf6a1439789fb7e6
Created March 26, 2019 15:47 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@sbalci
sbalci / .travis.yml
Created May 7, 2019 09:28 — forked from willprice/.travis.yml
How to set up TravisCI for projects that push back to github
# Ruby is our language as asciidoctor is a ruby gem.
lang: ruby
before_install:
- sudo apt-get install pandoc
- gem install asciidoctor
script:
- make
after_success:
- .travis/push.sh
env:
# =======================================
# = Enhancements to data tidying =
# = Hadley Wickham =
# = https://rstd.io/tidyhancements-2019 =
# =======================================
# What is tidy data? ----------------------------------------------------------
# 1. Each column is a variable.
# 2. Each row is an observation.
# 3. Each cell is a value.
@sbalci
sbalci / get_coursera_videos.sh
Created August 18, 2019 19:10
Download Coursera Videos
git clone https://github.com/coursera-dl/coursera-dl
cd coursera-dl
pip3 install -r requirements.txt
./coursera-dl -u <Email-id> -p <Password> --subtitle-language en raspberry-pi-interface
@sbalci
sbalci / ttttable.R
Created September 30, 2019 17:23 — forked from leeper/ttttable.R
Grammar of Tables?
# ttable: a grammar of tables
# https://gist.github.com/leeper/f9cfbe6bd185763762e126a4d8d7c286
# aggregate/summarize
# arrange
# annotation (metadata features)
# theme
@sbalci
sbalci / rename-jpg-files.r
Created October 29, 2019 10:08 — forked from summerofgeorge/rename-jpg-files.r
Rename all jpg files in a folder
# List the jpg files in the folder
old_files <- list.files("C:/ImageTest", pattern = "*.JPG", full.names = TRUE)
old_files
# Create vector of new files
new_files <- paste0("C:/NewFiles/file_",1:length(old_files),".JPG")
new_files
@sbalci
sbalci / 00.README.md
Created November 12, 2019 16:18 — forked from rmoff/00.README.md
RMarkdown - repeating child block with changing variable value

When you use knit_expand it appears that the inclusion of the Rmd is done on the first pass, and then the complete document evaluated. This means that a Rmd block referenced in loop with knit_expand will only evaluate changing variables at their last value.

This can be worked around by passing the literal value of the variable at the time of the knit_expand with {{var}} syntax.

This is documented in the knitr_expand docs, but less clear (to an R noob like me) for embedded documents rather than strings.

How to use Gephi to visualize from Wikidata

I'm a long-time fan of the graph visualization tool Gephi and since Wikimania 2019 I got involved with Wikidata. I was aware of the Gephi plugin "Semantic Web Importer", but when I check it out, I only find old tutorials connecting to DBpedia, not Wikidata:

simple_roc <- function(labels, scores){
labels <- labels[order(scores, decreasing=TRUE)]
data.frame(TPR=cumsum(labels)/sum(labels), FPR=cumsum(!labels)/sum(!labels), labels)
}