Skip to content

Instantly share code, notes, and snippets.

View adamrights's full-sized avatar

Adam Bedell adamrights

View GitHub Profile
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed
@adamrights
adamrights / snp
Created April 12, 2013 12:18 — forked from erikw/snp
#!/usr/bin/env bash
# Runs a command wrapped with btrfs pre-post snapshots.
log_path="/var/local/log/snp"
date=$(date "+%Y-%m-%d-%H%M%S")
log_file="${log_path}/snp_${date}.log"
# Log stdout and stderr. Reference: http://stackoverflow.com/questions/3173131/redirect-copy-of-stdout-to-log-file-from-within-bash-script-itself
exec > >(tee -a "$log_file")
exec 2> >(tee -a "$log_file" >&2)
#!/bin/bash -ex
# Paste this into ssh
# curl -sL https://gist.github.com/gists/2913223/download | tar -xzO | /bin/bash -ex
# When forking, you can get the URL from the download button.
pushd $HOME
aptget='sudo apt-get'
chsh='sudo chsh'