Skip to content

Instantly share code, notes, and snippets.

View praetoriansentry's full-sized avatar

John Hilliard praetoriansentry

View GitHub Profile
@praetoriansentry
praetoriansentry / perlcommand
Created December 29, 2011 21:16
Awk-like behavior with Perl
ps aux > test.txt;perl -p -w -e 'my @fields = split; $_ = $fields[1] . "\n"' test.txt
@praetoriansentry
praetoriansentry / _vimrc
Last active September 29, 2015 06:07
Snippets
set nocompatible
set number
set ruler
syntax on
" Set encoding
set encoding=utf-8
" Whitespace stuff
@praetoriansentry
praetoriansentry / jfh.me.bf
Created January 10, 2012 01:43
jfh.me in bf
++++++++++
[
> ++++++
> ++++
> +++++++
> +++++++
<<<< -
]
> +++++ +++++ ++++ .
---- .
@praetoriansentry
praetoriansentry / vimrc.vim
Created March 15, 2012 23:25
Latest vimrc file
" this seems like something i should set. Still not completely sure about
" what it does haha
" http://vimdoc.sourceforge.net/htmldoc/starting.html#compatible-default
set nocompatible
" add line numbers
set number
" show position numbers and info
set ruler
@praetoriansentry
praetoriansentry / btc.R
Created April 11, 2013 22:24
Quick script to plot the last 24hrs of mtgox trade data.
library("rjson")
library("quantmod")
json_file <- "https://data.mtgox.com/api/2/BTCUSD/money/trades/fetch"
json_data <- fromJSON(paste(readLines(json_file), collapse=""))
mtgox <- json_data$data
trades <- do.call(rbind.data.frame, mtgox)
@praetoriansentry
praetoriansentry / btc2.R
Last active December 16, 2015 03:09
Minor variation of the BTC script so that the amount of time can be controlled.
library("rjson")
library("quantmod")
##### Configuration #####
startTime <- as.integer(as.POSIXct(strptime("2013-04-09 00:00:00", "%Y-%m-%d %H:%M:%S")))
endTime <- as.integer(Sys.time())
bucketSize <- 60*15 # Fifteen minutes
##### Implementation #####
header {
background-image:url('{HeaderImage}');
width: 100%;
height: 400px;
background-size: cover;
background-position: 33%;
}
header > img {
display: block;
margin-left: auto;
<header>
<img class="portrait" src="{PortraitURL-128}" />
</header>
html {
background-color: {BackgroundColor};
font-family: {TitleFont};
}
body {
width:900px;
margin:0 auto;
background-color: white;
}
#posts {
padding: 25px;
}