Skip to content

Instantly share code, notes, and snippets.

View kaz-yos's full-sized avatar
💭
I may be slow to respond.

Kazuki Yoshida kaz-yos

💭
I may be slow to respond.
View GitHub Profile
@eddieh
eddieh / .msmtprc
Created February 29, 2020 18:38
msmtp configuration for iCloud email account
# -*- mode: conf; tab-width: 4; -*-
defaults
port 587
tls on
account primary
host smtp.mail.me.com
auth on
from account@icloud.com
@louisahsmith
louisahsmith / get_SER_abstracts.R
Created January 17, 2020 18:03
create a text file with all the SER abstracts assigned to you
library(rvest)
username <- "louisa_h_smith"
.password <- rstudioapi::askForPassword("SER password")
save_path <- "~/Desktop"
get_abstract_text <- function(i, review_homepage, titles) {
abstract <- jump_to(review_homepage, links[i])
text <- html_nodes(abstract, "article") %>%
html_children() %>%
@mikroskeem
mikroskeem / gccemacs_osx.md
Last active May 12, 2024 15:07
gccemacs on OSX

gccemacs on OS X

Read this first: http://akrl.sdf.org/gccemacs.html

Prerequisites

1) GCC with libgccjit enabled

For that you need to compile gcc (duh). I edited Homebrew's gcc formula:

@artizirk
artizirk / fix_maildir_mail_mtime.py
Created April 23, 2019 15:30
This script is useful for setting fallback mtime for isync/mbsync CopyArrivalDate option
#!/usr/bin/env python3
# This script is useful for setting fallback mtime for isync/mbsync CopyArrivalDate option
# If you use notmuch then you could do something like this to fix mtime on new mail
# notmuch search --output=files tag:new | xargs -P0 -i ~/code/mailutils/fix_maildir_mtime.py {}
import email
import sys
import os
from email.utils import parsedate_tz, mktime_tz
@tmalsburg
tmalsburg / rmarkdown-render.el
Last active April 26, 2018 17:23
Elisp function for rendering RMarkdown files to PDF. Shows the output of the render process in a separate window.
(defun tmalsburg-rmarkdown-render ()
"Compiles the current RMarkdown file to PDF and shows output of
the compiler process in a separate window."
(interactive)
(let* ((buf (get-buffer-create "*rmarkdown-render*"))
(temp-window (or (get-buffer-window buf)
(split-window-below -10)))
(command "Rscript -e 'library(rmarkdown); render(\"%s\", output_format=\"%s\")'")
(command (format command (buffer-file-name) "pdf_document")))
(set-window-buffer temp-window buf)
#' Chained Conditional Element Selection
#'
#' \code{cond} takes even number of arguments representing a series of
#' \code{test}/\code{value} pairs, and returns a value with the same shape as
#' every \code{test}. The returned element is filled with the elements selected
#' from every \code{value} depending on whether its corresponding \code{test} is
#' \code{TRUE} or \code{FALSE}.
#'
#' @param ... An even number of \code{test}/\code{value} pairs. Every \code{test}
#' is coerced to logical mode. \code{test} arguments should be the same shape.
@bxshi
bxshi / tmux_local_install.sh
Last active December 3, 2021 15:17 — forked from smsharma/ tmux_local_install.sh
Install tmux locally without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $INSTALL_DIR/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=2.3
if (!require("pacman")) install.packages("pacman")
pacman::p_load(dplyr, venneuler)
pacman::p_load_current_gh('trinker/textshape', 'thomasp85/ggforce')
x <- matrix(sample(0:4, 80, TRUE, c(.6, .1, .1, .1, .1)), ncol=4)
colnames(x) <- LETTERS[1:4]
@andersjohansson
andersjohansson / emacs-zotero-bib-fetch.el
Created March 31, 2016 10:05
Emacs-zotero-bib-fetch: fork of zotelo to use better-bibtex's pull export
;;; emacs-zotero-bib-fetch.el --- Manage Zotero collections from emacs
;;
;; Filename: emacs-zotero-bib-fetch.el
;; Author: Anders Johansson, based on zotelo by Spinu Vitalie
;; Maintainer: Anders Johansson
;; Copyright (C) 2011-2014, Anders Johansson and Spinu Vitalie
;; Created: 1 Jul 2014
;; Version: 1.2
;; URL: https://github.com/andersjohansson/emacs-zotero-bib-fetch
;; Keywords: zotero, emacs, reftex, bibtex, bibliography manager
#!/bin/sh
# This script will setup Evm (Emacs Version Manager) and Cask on
# Travis to use for Emacs Lisp testing.
#
# In .travis.yml, add this:
#
# - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh
#
# Emacs 24.3 is installed in the above script because Cask requires