Skip to content

Instantly share code, notes, and snippets.

View pfhawkins's full-sized avatar

P.F. Hawkins pfhawkins

View GitHub Profile
@pfhawkins
pfhawkins / index.html
Created January 4, 2019 00:15 — forked from jonathan-soifer/index.html
Very basic boilerplate Index.html for Hugo Static Website Generator
<!-- Doctype HTML5 -->
<!DOCTYPE html>
<html lang="en" />
<head>
<!-- Set character encoding for the document -->
<meta charset="UTF-8" />
<!-- Instruct Internet Explorer to use its latest rendering engine -->
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<!-- Viewport for responsive web design -->

Keybase proof

I hereby claim:

  • I am pfhawkins on github.
  • I am pfhawkins (https://keybase.io/pfhawkins) on keybase.
  • I have a public key ASDI-PPN43-zdGILtmeLF8ia6DfUJpZUThyp9u9bcNCGqAo

To claim this, I am signing this object:

require 'spidr'
require 'graphviz'
url_map = Hash.new { |hash,key| hash[key] = [] }
Spidr.site('http://hypervers.es/') do |spider|
spider.every_link do |origin, dest|
if dest.host == "hypervers.es"
if dest.path == '/stylesheets/all.css'
elsif dest.path == '/javascripts/all.js'
unbind C-b
set -g prefix C-a
bind-key V select-layout even-horizontal
bind-key H select-layout even-vertical
bind-key T select-layout tiled
bind-key S set-window-option synchronize-panes on
bind-key s set-window-option synchronize-panes off
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key k command-prompt -p "sent pane to:" "join-pane -t '%%'"
bind-key C-right swap-window -t -1
# put this at ~/.gitconfig
[alias]
# I'm lazy, so two letters will always trump the full command
co = checkout
ci = commit
cp = cherry-pick
st = status
br = branch
@pfhawkins
pfhawkins / flatten.xslt
Created January 24, 2012 21:16 — forked from nicferrier/flatten.xslt
flatten
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
xmlns:re="http://exslt.org/regular-expressions"
extension-element-prefixes="str regexp"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:output mode="text" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="//table//tr" mode="variables">
@pfhawkins
pfhawkins / macup.rb
Created January 3, 2012 20:55
upcases portions of a MAC address for some work copypasta
#!/usr/bin/env ruby
# Takes a single MAC address as an argument, returns it with the
# letters capitalized (both to STDOUT and clipboard)
# Example:
#
# ruby macup.rb 00:14:d1:13:97:c4
#
# will return:
# require the libraries to make it all work
require 'rubygems'
require 'active_support/core_ext'
require 'business_time'
# What time is it now? Of course, this will be different
# for you, so your relative answrs below will vary
# accordingly:
Time.now

Badass git pull alternative

Add this little snippet to your ~/.gitconfig and it amps up your git pull by means of git up

  1. Adds in a list of the commits you're pulling down
  2. Auto-prunes remote branches
  3. Defaults to pull --rebase - gets rid of unnecessary merge commits. If you don't know what rebase does, this is probably safe for you. If you know what rebase does, you should know where this will not be safe for you.

Scott Chacon and Ryan Tomayko basically figured out how to do this and I am stealing all of the credit.

@pfhawkins
pfhawkins / natread.py
Created December 7, 2009 21:14 — forked from simonw/natread.py
tweaked to use my username, cowsay instead of cowthink (per ubuntu)
#!/usr/bin/python
import json, urllib, os, textwrap
user = 'pfhawkins'
url = "http://twitter.com/statuses/user_timeline/%s.json"
pipe = os.popen("cowsay -n", 'w')
pipe.write('\n'.join(textwrap.wrap(
json.load(urllib.urlopen(url % user))[0]['text'])
))