Skip to content

Instantly share code, notes, and snippets.

View jsta's full-sized avatar
🪼
...

Jemma Stachelek jsta

🪼
...
View GitHub Profile
@mshkrebtan
mshkrebtan / webex-ubuntu.md
Last active October 28, 2022 15:23
Run Cisco Webex on 64-bit Ubuntu 16.04

Run Cisco Webex on 64-bit Ubuntu 16.04

With Audio and Screen Sharing Enabled

Enable support for 32-bit executables

Add the i386 architecture to the list of dpkg architectures :

sudo dpkg --add-architecture i386
anonymous
anonymous / pca_animation.m
Created January 26, 2017 21:47
Matlab code to produce PCA animations
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Matlab code to produce PCA animations shown here:
% http://stats.stackexchange.com/questions/2691
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Static image
clear all
rng(42)
@noamross
noamross / test_rstanarm_gamm4.R
Created November 21, 2016 02:29
Trying out rstanarm's new GAM support
library(rstanarm)
library(tidyverse)
library(viridis)
gtemp <- read.delim("http://www.metoffice.gov.uk/hadobs/hadcrut4/data/current/time_series/HadCRUT.4.5.0.0.annual_ns_avg.txt",
sep="", header = FALSE) %>%
select(1,2) %>%
set_names(c("Year", "Temperature"))
st_mod2 <- stan_gamm4(Temperature ~ s(Year), data = gtemp)
@bearloga
bearloga / upgrade_packages.R
Last active October 8, 2020 12:46
The script can be used to re-install packages after upgrading R (on Linux or Mac), since libraries cannot be reused between different minor versions (e.g. when upgrading 3.2.3 to 3.3.2). It detects when a package was installed from CRAN vs GitHub/Git and re-installs it using the appropriate func. Usage: `Rscript upgrade_packages.R`
# WMF only:
if (file.exists("/etc/wikimedia-cluster")) {
message('Detected that this script is being run on a WMF machine ("', Sys.info()["nodename"], '"). Setting proxies...')
Sys.setenv("http_proxy" = "http://webproxy.eqiad.wmnet:8080")
Sys.setenv("https_proxy" = "http://webproxy.eqiad.wmnet:8080")
}
# General use:
message("Checking for a personal library...")
if (!dir.exists(Sys.getenv("R_LIBS_USER"))) {
@keberwein
keberwein / projections.R
Last active July 4, 2021 20:38
Map projections for the USA
# Makes sure the required packs are loaed, if not, intalles them.
pkgs <-c ('sp','ggplot2','rgdal','broom','maptools','tigris', 'blscrapeR')
for(p in pkgs) if(p %in% rownames(installed.packages()) == FALSE) {install.packages(p, repos='http://cran.us.r-project.org')}
for(p in pkgs) suppressPackageStartupMessages(library(p, quietly=TRUE, character.only=TRUE))
# Before we get into the projections, let's download some unemployment data to map.
county_dat <- get_bls_county()
# We also need a shapefile with the appropriate FIPS codes.
state <- counties(cb = TRUE, year = 2015)
@lightonphiri
lightonphiri / bash-install_google_fonts_on_ubuntu.md
Last active July 27, 2025 00:19
Install Google Fonts on Ubuntu

Install Google Fonts

Download desired fonts

https://fonts.google.com/?selection.family=Open+Sans

Install Google Fonts on Ubuntu

cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip

@artemklevtsov
artemklevtsov / .gitlab-ci.yml
Last active January 12, 2024 04:14
Testing R package with GitLab CI (with code coverage)
variables:
CODECOV_TOKEN: "CODECOV_TOKEN_STRING"
_R_CHECK_CRAN_INCOMING_: "false"
_R_CHECK_FORCE_SUGGESTS_: "true"
APT_PKGS: "libcurl4-openssl-dev libssh2-1-dev libssl-dev libxml2-dev zlib1g-dev git"
before_script:
- apt-get update
- apt-get install -y --no-install-recommends ${APT_PKGS}
- apt-get install -y --no-install-recommends qpdf pandoc pandoc-citeproc
@perrygeo
perrygeo / gdal_install.sh
Created July 13, 2016 16:58
Install multiple gdal versions to /usr/local/gdal/
#!/bin/bash
set -ex
GDALBUILD="$(realpath `dirname $BASH_SOURCE`)/build"
GDALINST="/usr/local/gdal"
CPUS=4
GDALOPTS=" --with-webp=yes \
--with-geos=/usr/local/bin/geos-config \
--with-static-proj4=/usr/local \
@ashiklom
ashiklom / missing.R
Created June 16, 2016 01:19
Multivariate normal fit with missing values in STAN
library(rstan)
library(MASS)
# Simulate some data
mu <- c(10, 5, -5)
Sig <- matrix(c(1, 0.7, 0.8,
0.7, 2, 0.2,
0.8, 0.2, 1.5),
3, 3)
N <- 100

Fix 2016-05-06

svn checkout svn://scm.r-forge.r-project.org/svnroot/rgdal/pkg mv pkg rgdal R CMD build rgdal --no-build-vignettes --no-manual sudo R CMD INSTALL rgdal_1.1-9.tar.gz

R