Skip to content

Instantly share code, notes, and snippets.

@aaronberdanier
aaronberdanier / Sankey.R
Created December 2, 2011 14:50
Program for creating sankey diagrams in R
SankeyR <- function(inputs, losses, unit, labels, format="plot"){
########################
# SankeyR version 1.01 (updated August 10, 2010)
# is a function for creating Sankey Diagrams in R.
# See http://www.sankey-diagrams.com for excellent examples of Sankey Diagrams.
#
# OPTIONS:
# 'inputs' is a vector of input values
# 'losses' is a vector of loss values
# 'unit' is a string of the unit
@yihui
yihui / readme.md
Created March 5, 2012 07:09
Filling a full beamer slide with tikzDevice output from R
@ajmcdaniel
ajmcdaniel / zip_database.py
Created April 13, 2012 02:03
Snippet to dump and load zipped sqlite3 databases, based on Eli Bendersky's example. Useful for storing sqlite3 databases from memory to disk
import zipfile
def dump_database(connection, dump_file, sql_file):
"""Function to dump sqlite3 database into zipped file
see: http://bit.ly/IAUmKc
python 2.6+ only
connection: sqlite3 database connection
@mages
mages / googleVis_with_knitr_and_RStudio.Rmd
Created May 15, 2012 19:59
Interactive reports in R with knitr and RStudio
My first examples with [***knitr***](http://yihui.name/knitr/)
-----------------------------------------
Let's include some simple R code:
```{r}
1+2
```
That worked.
Let's include a plot:
```{r fig.width=4, fig.height=4}
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 16, 2024 19:37
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@afair
afair / tmux.cheat
Last active June 3, 2024 23:26
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New new -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@barnes7td
barnes7td / sublime_plugins.md
Created October 5, 2012 02:07
Sublime Plugins for Ruby and Rails

Sublime Plugins for Ruby and Rails

General

I would start by installing the Sublime Package Control manager. This tool will allow you to install the other plugins without having to clone git repositories and copying them to the correct folders. Instead you will the command drop-down menu with "Ctrl + Shift + P" and then scrolling down until you see "Package Control: Install Package". A search bar will pop up and you can type the name of a package, click on the name and it will self install. If you have problems setting any of these up email me at barnes7td@gmail.com

Packages/Plugins

  1. Sublime Package Control - Install this first. This tool will allow you to easily install most (if not all) the other plugins in this list. (Ctrl + Shift + P, then select Package Control: Install Package)

  2. SublimeERB - This plugin auto creates the erb tags. (<% %>, <%= %>, etc.) (Ctrl +

@amueller
amueller / Diagram1.dia
Last active August 18, 2022 05:03
Machine learning cheat sheet diagram svg and dia file
@dgrapov
dgrapov / Orthogonal Signal Correction (OSC) for PLS models OSC-PLS (OPLS)
Last active November 28, 2023 03:28
Orthogonal Signal Correction for PLS models (OPLS)
#see updated code base and some examples in the function "test"
# https://github.com/dgrapov/devium/blob/master/R/Devium%20PLS%20%20and%20OPLS.r
#Orthogonal Signal Correction for PLS models (OPLS)
#adapted from an example in the book <a href="http://www.springer.com/life+sciences/systems+biology+an+bioinfomatics/book/978-3-642-17840-5">"Chemometrics with R by Ron Wehrens"</a>
#this code requires the following packages:
need.packages<-c("pls", # to generate PLS models
"ggplot2" ) # to plot results
@fperez
fperez / 00-Setup-IPython-PySpark.ipynb
Last active December 21, 2015 23:48
HowTo for starting an IPython Notebook server
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.