Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@DougManuel
DougManuel / Rprofile.R
Created December 6, 2018 02:57 — forked from stephenturner/Rprofile.R
Rprofile.R
# To source this file into an environment to avoid cluttering the global workspace, put this in Rprofile:
# my.env <- new.env(); sys.source("C:/PathTo/THIS_FILE.r", my.env); attach(my.env)
#-----------------------------------------------------------------------
# Load packages, set options and cwd, set up database connection
#-----------------------------------------------------------------------
## Load packages
# require(ggplot2) #plotting
# require(plyr) #data manipulation
@DougManuel
DougManuel / clickable-imgs.js
Created December 6, 2018 02:57 — forked from bearloga/clickable-imgs.js
Make the figures click-able in your RMarkdown=>HTML reports.
<script language="JavaScript">
$(function() {
/* Lets the user click on the images to view them in full resolution. */
$("div.figure img").wrap(function() {
var link = $('<a/>');
link.attr('href', $(this).attr('src'));
link.attr('title', $(this).attr('alt'));
link.attr('target', '_blank');
return link;
});
@DougManuel
DougManuel / BarChart.js
Created April 3, 2017 06:11 — forked from ThomasBurleson/BarChart.js
Reusable Chart component for D3 - using prototypes and factories
(function() {
// Based on article @ http://www.toptal.com/d3-js/towards-reusable-d3-js-charts
// Publish a factory method for Chart instances
// @usage:
// var runningChart = BarChart.instanceOf( {barPadding : 2 } );
// var weatherChart = BarChart.instanceOf()
// .fillColor('coral');
window.BarChart = {
@DougManuel
DougManuel / .block
Created March 12, 2017 14:07
LAP-JV
license: mit
border: no
@DougManuel
DougManuel / defineVarsFromClassName.js
Last active August 29, 2015 14:25 — forked from netsi1964/defineVarsFromClassName.js
Define in global scope vars for each used CSS classname
(function defineVarsFromClassName() {
var needVar = $("[class]"),
definedVars = "";
for (var i = 0; i < needVar.length; i++) {
var $this = $(needVar[i]);
var classes = $this.attr("class").split(" ");
for (var ii = 0; ii < classes.length; ii++) {
var sClassName = $.trim(classes[ii]);
if (sClassName.length > 0) {
var $us = $("." + sClassName);