Skip to content

Instantly share code, notes, and snippets.

@timelyportfolio
timelyportfolio / Readme.md
Last active December 15, 2015 07:39
gist of clickme for bl.ocks.org viewing

#Unbelievable clickme d3 straight from R

I deserve no credit for this. Go to clickme for the guy that deserves all the credit. I just simply put it in Gist form for it to show up on bl.ocks.org

@ramhiser
ramhiser / find_peaks.r
Last active July 2, 2021 06:08
Find local maxima (peaks) in a vector
#' Finds the local maxima (peaks) in the given vector after smoothing the data
#' with a kernel density estimator.
#'
#' First, we smooth the data using kernel density estimation (KDE) with the
#' \code{\link{density}} function. Then, we find all the local maxima such that
#' the density is concave (downward).
#'
#' Effectively, we find the local maxima with a discrete analogue to a second
#' derivative applied to the KDE. For details, see this StackOverflow post:
#' \url{http://bit.ly/Zbl7LV}.
@hadley
hadley / html.r
Last active December 18, 2015 03:58
# We first start by creating a way of escaping the characters that have special
# meaning for html, while making sure we don't end up double-escaping at any
# point. The easiest way to do this is to create an S3 class that allows us to
# distinguish between regular text (that needs escaping) and html (that
# doesn't).
#
# We then write an escape method that leaves html unchanged and escapes the
# special characters (&, <, >) in ordinary text. We also add a method for lists
# for convenience
@seba--
seba-- / .gitconfig
Last active December 21, 2015 10:49 — forked from jacaetevha/.gitconfig
[diff "word"]
binary = true
textconv = docx-to-txt.rb -t

How to make the blue shapes in Keynote go away

Create a standard shape

image

The styles are not just on the object but also in the Shape Stye on the upper left of the style panel

image

Style your new defaults on the example shape

var Stars = function (props) {
var rating = props.rating || 0; // rating from 0 to 5, inclusive, in increments of 0.5
var label = props.label || null; // a label to describe the contents (for accessibility)
var src = "./img/stars_" + rating + ".svg";
return <img src={src} width="78" height="13" aria-label={label} data-tooltip={label}/>;
};
module.exports = Stars;