This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo npm -g install | |
sails new testProject | |
cd testProject | |
sails lift | |
# navigate to http://localhost:1337 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var server = http.createServer(function(req, res) { | |
res.writeHead(200); | |
res.end('Hello Http'); | |
}); | |
server.listen(8080); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~ | |
mkdir src && cd src | |
wget -N http://nodejs.org/dist/node-latest.tar.gz | |
tar xzvf node-latest.tar.gz && cd node-v* | |
# when it asks if you want to change anything remove "v" from the version number | |
./configure | |
sudo checkinstall | |
sudo dpkg -i node_* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
options(rstudio.markdownToHTML = | |
function(inputFile, outputFile) { | |
require(markdown) | |
markdownToHTML(inputFile,"tmp.html",fragment.only=TRUE) | |
system(paste("pandoc", "-s -S --toc","tmp.html", "-o", outputFile)) | |
} | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Preamble | |
\documentclass{Article} | |
\usepackage{Sweave} | |
% Start Document | |
\begin{document} | |
% Titlepage | |
\begin{titlepage} | |
\title{A Title} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* On line 242, find the following code */ | |
$meta = '<p class="entry-meta">' . __( '[entry-terms taxonomy="category" before="Posted in "] [entry-terms taxonomy="post_tag" before="| Tagged "] [entry-comments-link before="| "]', hybrid_get_textdomain() ) . '</p>'; | |
/* And replace it with the following line */ | |
$meta = '<p class="entry-meta">' . __( '[entry-terms taxonomy="category" before="Posted in "] [entry-terms taxonomy="post_tag" before="| Tagged "]', hybrid_get_textdomain() ) . '</p>'; | |
/* Voila, you're finished. */ | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Title: ggplot2 Introduction: Plotting Maps | |
## Description: This line by line analysis, provides an introduction to ggplot2. Mapping. | |
## Created by: Brandon Bertelsen: Research Manager, Credo Consulting Inc. | |
# install.packages(maptools) | |
library(maptools) | |
library(ggplot2) | |
# Must allow for licensing | |
gpclibPermit() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Title: ggplot2 Introduction: Correlation Heatmap | |
## Description: This line by line analysis, provides an introduction to ggplot2. Correlation Heatmap | |
## Created by: Brandon Bertelsen: Research Manager, Credo Consulting Inc. | |
## Heatmap example courtesy of: http://learnr.wordpress.com/2010/01/26/ggplot2-quick-heatmap-plotting/ | |
# Run correlations | |
e.new <- as.data.frame(cor(e[2:ncol(e)])) | |
# Reset rownames | |
e.new <- data.frame(row=rownames(e.new),e.new) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Title: ggplot2 Introduction: Part IV | |
## Description: This line by line analysis, provides an introduction to ggplot2. Scorecards | |
## Created by: Brandon Bertelsen: Research Manager, Credo Consulting Inc. | |
## Save plots as objects | |
p1 <- ggplot(d, aes(clarity, price)) + geom_boxplot() | |
p2 <- ggplot(d, aes(price)) + geom_histogram() + facet_grid(~cut) | |
p3 <- ggplot(d, aes(price, carat, color=clarity)) + geom_point() | |
# Function courtesy of Hadley Wickham |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Title: ggplot2 Introduction: Part IV | |
## Description: This line by line analysis, provides an introduction to ggplot2. Time series. | |
## Created by: Brandon Bertelsen: Research Manager, Credo Consulting Inc. | |
# Review the economics data set from the ggplot2 intro | |
e <- economics | |
str(e) | |
# Let's look at geom_line | |
ggplot(e, aes(date, uempmed)) + geom_line() |