Skip to content

Instantly share code, notes, and snippets.

@bds
bds / gist:3733733
Created September 16, 2012 18:49
Ignore EOL characters in a git diff
git diff HEAD --ignore-space-at-eol
@bds
bds / SparkLines in R
Created December 30, 2010 14:27
Sample sparkline plot using ggplot
library(ggplot2)
sparkLinePlot <- function(df, plot.file) {
highest <- subset(df, outcomes == max(outcomes))
lowest <- subset(df, outcomes == min(outcomes))
p <- ggplot(df, aes(x=date, y=outcomes)) +
geom_line() +
opts(panel.border = theme_rect(linetype = 0),
@bds
bds / gist:3210386
Created July 30, 2012 21:22
Encrypt and decrypt files with openssl
# http://osxdaily.com/2012/01/30/encrypt-and-decrypt-files-with-openssl/
# Encrypt
openssl des3 -in file.txt -out encrypted.txt
# Decrypt
openssl des3 -d -in encrypted.txt -out normal.txt
@bds
bds / gist:4192180
Created December 3, 2012 02:11
Subset an R dataframe by a list of dates
subset(df, sprint.end.date %in% as.Date(c("2012-11-16", "2012-11-30")))
@bds
bds / .bashrc
Last active January 14, 2021 19:12
dotfiles
# Cult of Vi
set -o vi
export VISUAL=vim
export EDITOR="$VISUAL"
# Colors!
alias ls='ls -G'
# History
export HISTFILE=~/.bash_history
@bds
bds / .dockerignore
Last active March 25, 2020 04:03
Crystal Docker Starter
.env
.gitignore
*.swp
node_modules
npm-debug.log
@bds
bds / docker-shell.sh
Created June 17, 2019 17:06 — forked from falvarez/docker-shell.sh
Run docker container, mount current working directory and get interactive shell
docker run -ti -v $(pwd):/tmp DOCKER_IMAGE /bin/bash
@bds
bds / docker-image-delete-feedback.sh
Created May 28, 2019 16:15
Delete Docker images with feedback
# https://github.com/docker/for-mac/issues/2501#issuecomment-436997480
docker images -f "dangling=true" -q | xargs -I {} echo docker rmi -f {}
@bds
bds / .dockerignore
Last active May 28, 2019 05:11
Docker Node Starter
.env
.gitignore
*.swp
node_modules
npm-debug.log
@bds
bds / jwtRS256.sh
Created May 27, 2019 04:00 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub