Skip to content

Instantly share code, notes, and snippets.

View naupaka's full-sized avatar

Naupaka Zimmerman naupaka

View GitHub Profile
@dehowell
dehowell / Evernote+Link+Network.ipynb
Created May 2, 2018 11:22
Evernote Link Network
#!/usr/bin/env Rscript
json_in <- file('stdin', 'r')
lat_newp <- '{"t":"RawBlock","c":["latex","\\\\newpage"]}'
doc_newp <- '{"t":"RawBlock","c":["openxml","<w:p><w:r><w:br w:type=\\"page\\"/></w:r></w:p>"]}'
ast <- paste(readLines(json_in, warn=FALSE), collapse="\n")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active June 24, 2026 22:28
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@maxandersen
maxandersen / trigger-list.org
Last active December 3, 2024 17:17
I like the idea of trigger list to empty my head for TODO's so I went and created a .org version of David Allens GTD trigger list. Note: it looks much better when used from within .org mode.
@iandol
iandol / BEtoOPML.scpt
Last active May 13, 2019 14:42
Bookends to OPML Exporter — Applescript by Dave83 with some further tweaks; see https://www.sonnysoftware.com/phpBB3/viewtopic.php?f=6&t=3882
#!/usr/bin/osascript
--Script to Export Bookends Notes to OPML file v1.18
--Written by Dave Glogowski (modified by iandol)
--07 August 2017
--
--This script converts Bookends references and associated notes into an OPML structured file which can then be imported into Scrivener's research folder.
--Each reference is a top level card which contains the Title, Author, Date, Type, Publisher, Abstract, and Bookends citation key
--If there are notes associated with a reference, each note creates its own subordinate note card with the Page number (if any), note header, quotes,
--comments, and keywords (tags). This allows you to individually review each comment and change its status (label) within Scrivener.
--
@thomasmansencal
thomasmansencal / taskpaper2org.py
Last active October 19, 2025 20:27
Omnifocus Taskpaper Export to Org-Mode
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Converts from *Omnifocus* *taskpaper* export to *org-mode*.
Examples
--------
> python taskpaper2org.py omnifocus.txt > omnifocus.org
Notes
@benmarwick
benmarwick / load_pkgs.R
Last active December 7, 2018 16:05
Providing CRAN packages in low- or no-bandwidth environments using miniCRAN as described in https://software-carpentry.org/blog/2015/03/teaching-in-yangon.html
## For the user with a new installation of R.
# They get a USB stick with a directory containing an .RProj file,
# the workshop files, and the local_CRAN directory. They open
# the .RProj, which sets the working directory for RStudio, and then
# they open this file and run it, which installs pkgs from
# the local_CRAN directory on the USB stick.
# Specify list of packages to install
pkgs <- c('ggplot2', 'rmarkdown', 'knitr')
@johnmackintosh
johnmackintosh / HeatmapHrByDay.R
Last active July 16, 2026 17:08
How I made the hourly~daily~monthly~yearly heatmap : https://www.r-graph-gallery.com/283-the-hourly-heatmap.html
# https://www.r-graph-gallery.com/283-the-hourly-heatmap.html
library(ggplot2)
library(dplyr) # easier data wrangling
library(viridis) # colour blind friendly palette, works in B&W also
library(Interpol.T) # will generate a large dataset on initial load
library(lubridate) # for easy date manipulation
library(ggExtra) # because remembering ggplot theme options is beyond me
library(tidyr)
@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"))) {