This file contains 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
// ==UserScript== | |
// @name Remove Facebook's external link tracking | |
// @description Removes redirection and the "click identifier" from external links on FBs | |
// @namespace https://gist.github.com/k-barton | |
// @match https://*.facebook.com/* | |
// @version 0.3.7 | |
// @grant unsafeWindow | |
// @run-at document-start | |
// ==/UserScript== | |
(function() { |
This file contains 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
# All arguments as in `graphics::text`, except pad which specifies padding (optionally | |
# for vertical and horizontal) around the text as a fraction of a character width. | |
# `...` is passed to `rect` | |
textbox <- | |
function(x, y, labels, adj = NULL, | |
pos = NULL, | |
offset = 0.5, | |
pad = c(0, 0), | |
vfont = NULL, | |
cex = par("cex"), |
This file contains 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
@echo off | |
setlocal EnableDelayedExpansion | |
set result= | |
set outfile= | |
set nextisoutfile= | |
set "self=%~n0" | |
:startHelp |
This file contains 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
require("MuMIn") | |
local({ | |
quasiLik.compar.gee <- | |
function (object, ...) { | |
scale <- object$scale | |
ret <- .qlik(object$residuals + object$fitted.values, object$fitted.values, | |
get(object$family, envir = asNamespace("stats"))(), | |
1, scale) |
This file contains 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
local({ | |
family.phylolm <- | |
function (object, ...) { | |
stop("???") | |
} | |
logLik.pglmm_compare <- | |
function (object, ...) { | |
rval <- object$logLik |
This file contains 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
sd.ranef.avg <- | |
function(object) { | |
if(!inherits(object, "averaging")) | |
stop("not an \"averaging\" object") | |
mo <- get.models(object, TRUE) | |
re <- lapply(mo, function(x) as.data.frame(ranef(x, condVar = TRUE))) | |
cols <- c("grpvar", "term", "grp") |
This file contains 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
// ==UserScript== | |
// @name Remove Google's link tracking | |
// @description Removes onmousedown event from external Google links to allow direct links | |
// @namespace https://gist.github.com/k-barton | |
// @include http://*.google.* | |
// @include https://*.google.* | |
// @version 0.2.1 | |
// @grant unsafeWindow | |
// @run-at document-end | |
// ==/UserScript== |
This file contains 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
#' @return a two-column matrix of turning angles `"ta"` and step lengths `"len"`. | |
#' @param Nstates the number of movement states. | |
#' @param tp a vector of transition probabilities for `Nstates == 2` or a | |
#' square transition matrix `[Nstates, Nstates]`. Ignored if `Nstates == 1` | |
#' @param mu,rho wrapped Cauchy distribution parameters for the turning angles. Should have a length of `Nstates`. | |
#' @param wscale,wshape Weibull distribution parameters for step length | |
# TODO: starting position and initial direction. Currently all are set to 0. | |
mscrwpath <- | |
function(N, Nstates = 2, tp = c(.05, .1), | |
mu = c(0, 0), rho = c(.5, .99), |
This file contains 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
#' @param expr an \R expression to produce the plot content. | |
#' @param fig numeric of length 1 or 2. The proportion of the plotting region to | |
#' be taken as the subplot plotting region (horizontal, vertical). | |
#' @param pos subplot position as a keyword, including "top", "bottom", "left", | |
#' "right". Empty string for centered plot. | |
#' @param inset numeric of length 1 or 2, giving inset distance(s) from the | |
#' margins in inches. | |
subplot <- | |
function(expr, fig = .33, pos = "topleft", inset = c(0, 0)) { |
This file contains 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
#' @param formula,data,subset,na.action arguments to `model.frame`. If the first argument is a data frame, the rest is ignored. | |
#' @param method argument to `cor.test`. A character string indicating which correlation coefficient is to be used for the test. One of "pearson", "kendall", or "spearman", can be abbreviated. | |
#' @param n integer; the number of x values at which to evaluate. | |
#' @param lty,col,cex graphical parameters fit line type, line colour, character expansion for labels. | |
#' @param \dots optional, additional arguments passed to `points` | |
#' @example | |
#' data <- data.frame(x = runif(100), x1 = rlnorm(100), x2 = rnorm(100)) | |
#' pairs.cor(~ x + log(x1) + x2, data) | |
pairs.cor <- | |
function(formula, data = NULL, subset = NULL, na.action = na.fail, |
NewerOlder