Skip to content

Instantly share code, notes, and snippets.

View justmytwospence's full-sized avatar

Spencer justmytwospence

View GitHub Profile
@tpope
tpope / cloud2butt.vim
Created September 18, 2014 06:12
Cloud to Butt dot Vim
function! s:butt() abort
syn match cloud2butt "\<th\%(e cloud\>\)\@=" conceal cchar=m
syn match cloud2butt "\%(\<th\)\@<=e\%( cloud\>\)\@=" conceal cchar=y
syn match cloud2butt "\%(\<the \)\@<=c\%(loud\>\)\@=" conceal cchar=b
syn match cloud2butt "\%(\<the c\)\@<=l\%(oud\>\)\@=" conceal cchar=u
syn match cloud2butt "\%(\<the cl\)\@<=o\%(ud\>\)\@=" conceal cchar=t
syn match cloud2butt "\%(\<the clo\)\@<=ud\>" conceal cchar=t
endfunction
@christophergandrud
christophergandrud / R_Jags_AmazonEc2_Setup.sh
Last active October 28, 2017 20:26
Demonstration script for setting up R, Git, and Jags on Ubuntu instance of Amazon EC2 Server
# Set up RStudio and JAGS on an Amazon EC2 instance
# Using Ubuntu 64-bit
# Partially from http://blog.yhathq.com/posts/r-in-the-cloud-part-1.html
# See yhat for EC2 instance set up
# Navigate to key pair
# ssh -i YOUR_KEYPAIR.pem ubuntu@PUBLIC_DNS
# Add a user/password.
# This will become your RStudio username and password.
@seandavi
seandavi / bootstrap-template.html
Last active December 29, 2015 06:19
Simple bootstrap template for use with knitr
<!DOCTYPE html>
<html>
<head>
<title>#!title#</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
@minrk
minrk / nbstripout
Last active June 6, 2023 06:23
git pre-commit hook for stripping output from IPython notebooks
#!/usr/bin/env python
"""strip outputs from an IPython Notebook
Opens a notebook, strips its output, and writes the outputless version to the original file.
Useful mainly as a git filter or pre-commit hook for users who don't want to track output in VCS.
This does mostly the same thing as the `Clear All Output` command in the notebook UI.
LICENSE: Public Domain
@cboettig
cboettig / knitr_defaults.R
Last active November 30, 2022 09:16
My common knitr defaults
# My preferred defaults (may be changed in individual chunks)
opts_chunk$set(tidy=FALSE, warning=FALSE, message=FALSE, cache=TRUE,
comment=NA, verbose=TRUE, fig.width=6, fig.height=4)
# Name the cache path and fig.path based on filename...
opts_chunk$set(fig.path = paste("figure/",
gsub(".Rmd", "", knitr:::knit_concord$get('infile')),
"-", sep=""),
cache.path = paste(gsub(".Rmd", "", knitr:::knit_concord$get('infile') ),
"/", sep=""))
@biovisualize
biovisualize / index.html
Last active February 15, 2017 13:25
Posting gist/blocks to blogger
<!-- Override Gist styling -->
<style type="text/css">
iframe{background-color: #0a0a0a;}
div.gist-syntax {background-color:#0a0a0a!important;}
div.gist {color:#ccc!important;}
span.nt, span.kd, span.k, span.o{color:aliceblue!important;}
.gist .gist-file{border-color:#444!important;}
.gist .gist-file .gist-meta{background-color:#0a0a0a!important;}
</style>
@sway
sway / fontawesome.sty
Created July 12, 2012 23:14
FontAwesome mapping for XeLaTeX
% FontAwesome (http://fortawesome.github.com/Font-Awesome/) bindings for (Xe)LaTeX
% Author: Honza Ustohal <honza@egoistic.biz>
%
% Translation of FontAwesome's private range characters into XeTeX symbols. All icons are camel-cased and prefixed with 'fa', i.e. what was .icon-align-center the CSS version of FontAwesome becomes \faAlignCenter
% This might be reworked into a full blown package in the near future
%
% Prerequisite:
% XeLaTeX, FontAwesome installed as a system font accessible by XeLaTeX
%
% Usage:
@tomschenkjr
tomschenkjr / Remove-period-as-R-separator
Last active October 6, 2015 20:38
Remove period (.) as a separator in R script.
// Characters that are considered to separate words – does not include periods.
// Place comma at the end of the line if there are multiple keybindings.
{"word_separators": "/\\()\"‘-:,;~!@#$%^&*|+=[]{}`~?"}
@judy-zz
judy-zz / variables.css.less
Created June 18, 2012 03:45
Solarized colors for Twitter Bootstrap
@black: #002b36;
@grayDarker: #586e75;
@grayDark: #657b83;
@gray: #839496;
@grayLight: #93a1a1;
@grayLighter: #eee8d5;
@white: #fdf6e3;
@blue: #2aa198;
@blueDark: #268bd2;
@jboner
jboner / latency.txt
Last active May 24, 2024 16:18
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD