Skip to content

Instantly share code, notes, and snippets.

View jmervine's full-sized avatar

Joshua Mervine jmervine

View GitHub Profile
@jmervine
jmervine / .zshrc
Created October 23, 2014 20:16
zsh git branch in prompt functions
function git_branch_string {
stat=`git status`
if test "$(echo $stat | grep "^# On branch")"; then
echo "`git status | grep "^# On branch .*$" | cut -d " " -f 4`"
else
echo "`git status | grep "^On branch .*$" | cut -d " " -f 3`"
fi
}
function git_branch {
{
"server": "",
"id": "pagespeedtest_test",
"domain": "http:\/\/www.yellowpages.com",
"result": "success",
"message": {
"kind": "pagespeedonline#result",
"id": "http:\/\/www.yellowpages.com\/",
"responseCode": 200,
"title": "YP.com - Yellow Pages, the new yellowpages.com",

WPO: Recommended Data Points

Critial

These are must have items when displaying KPI information regarding a pages speed.

  • HTTP Traffic Completed (Phantomas)
    • How long it took for the browser to finish getting all data transfered -- including external content (CSS, JS, etc.)
  • HTTP Request Count (Phantomas)
  • Total number of HTTP requests (CSS, JS, etc.) made while loading the page.
@jmervine
jmervine / 1_docker_app_ex.md
Last active August 29, 2015 14:08
Docker Application Example
Application Example
# note to self, replace with repo
git clone https://gist.github.com/2d05dc10f9953b70788a.git hello-node
cd hello-node
mv hello-node.index.js index.js
mkdir public
mv hello-node.public.hello.html public/hello.html
@jmervine
jmervine / functions.vim
Created November 7, 2014 00:14
String whitespace with blacklist support.
" strip unwanted trailing whitespace
"
" usage:
" autocmd BufWritePre * call StripTrailingWhitespace()
" autocmd FileType jade let b:noStripWhitespace=1
"
fun! StripTrailingWhitespace()
" Only strip if the b:noStripeWhitespace variable isn't set
if exists('b:noStripWhitespace')
return
@jmervine
jmervine / tree.js
Last active August 29, 2015 14:08
JavaScript: tree -- traverse directories.
function tree(loc) {
// windows support
var seg = loc.split(path.sep);
var diskLoc, realLoc;
if (seg[0] === 'public') {
diskLoc = seg.join(path.sep);
realLoc = seg.slice(1).join(path.sep);
} else {
diskLoc = path.join('public', seg.join(path.sep));
# Latest Docker on CentOS
# - the hack-nasty way
###
# on a clean machine without docker
sudo yum install docker-io # gives init and such
sudo wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O /usr/bin/docker
# on an existing docker install
sudo service docker stop
@jmervine
jmervine / f5-icontrol.sh
Last active August 29, 2015 14:09
Install latest f5-icontrol via Bundler
#!/bin/bash
# Install latest f5-icontrol via Bundler
# - run this inside your project directory
VERSION=11.3
# remove old versions for update
test -d ext && rm -rf ext
mkdir ext
t, err := tail.TailFile("/var/log/nginx.log", tail.Config{
Follow: true,
ReOpen: true})
for line := range t.Lines {
fmt.Println(line.Text)
}
unbind A
bind A command-prompt "rename-window %%"
unbind %
bind | split-window -h
bind v split-window -h
unbind '"'
bind - split-window -v
bind _ split-window -v
bind h split-window -v