Skip to content

Instantly share code, notes, and snippets.

View njudd's full-sized avatar
🦄
magic unicorn

Nicholas Judd njudd

🦄
magic unicorn
View GitHub Profile
# Create a map of traces using Google Location History #
# get your google maps data:
# https://www.howtogeek.com/725241/how-to-download-your-google-maps-data/
library(dplyr) # data wrangling
library(lubridate) # date parsing
library(ggplot2) # plotting
library(jsonlite) # reading in json file
library(sf) # spatial
@echuber2
echuber2 / pl-rocker-local-test.sh
Last active December 9, 2022 23:30
Local tester for Rocker RStudio image on M1 Macs
#!/bin/bash
# Local tester for the PrairieLearn Workspaces version of Rocker. We'd like to
# find out if this truly works on M1 Macs (and why). The macOS version of
# Docker Desktop should handle permissions appropriately here, but this script
# may not work on Windows and Linux. If you are not using macOS, just use
# normal Rocker instead of this script.
# 20220111 Eric Huber
# USAGE INSTRUCTIONS
@danjgale
danjgale / pysurfer.md
Created August 9, 2018 18:04
Pysurfer installation guide for Python 3.6

Installing Pysurfer with Python 3.6

Pysurfer can be a bit tough to install because the dependencies (e.g., Mayavi) can be tricky to get right. Further, the documentation, at the time of this writing, states that Pysurfer only works with Python 2.7. This is not entirely the case, as Pysurfer does in fact work with Python 3. Here, I've documented the installation steps to get Pysurfer working with Python 3 on OSX (I'm guessing these steps also hold for Linux; not sure about Windows).

Setup

Before we begin, you'll need conda installed to create a virtual environment, and you will also need Freesurfer installed on your computer (follow the installation steps for your operating system, as is, here).

Then, let's set up our conda environment. We'll want to specify Python 3.6 and install some dependencies:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs