Skip to content

Instantly share code, notes, and snippets.

View zerweck's full-sized avatar

zerweck

View GitHub Profile
@hrbrmstr
hrbrmstr / badmail.Rmd
Last active December 1, 2016 07:59
Code for this post:
---
title: "Visualizing the Clinton Email Network in R"
author: "hrbrmstr"
date: "`r Sys.Date()`"
output: html_document
---
```{r include=FALSE}
knitr::opts_chunk$set(
collapse=TRUE,
comment="#>",
@dmarcelinobr
dmarcelinobr / network_basic.R
Last active June 22, 2019 06:18
network_basic
# Tutorial and data based on the network visualization workshop published over https://rpubs.com/kateto/netviz
#packages:
library(igraph)
library(RCurl)
# get the data
nodes <- read.csv("https://raw.githubusercontent.com/danielmarcelino/Datasets/master/Media-NODES.csv", header=T, as.is=T)
ties <- read.csv("https://raw.githubusercontent.com/danielmarcelino/Datasets/master/Media-EDGES.csv", header=T, as.is=T)
# Explore data:
@thigm85
thigm85 / lda_vs_pca.R
Last active March 16, 2021 11:31
Visualize the difference between PCA and LDA on the iris dataset.
require(MASS)
require(ggplot2)
require(scales)
require(gridExtra)
pca <- prcomp(iris[,-5],
center = TRUE,
scale. = TRUE)
prop.pca = pca$sdev^2/sum(pca$sdev^2)
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 23, 2024 09:05
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite