Skip to content

Instantly share code, notes, and snippets.

View paulstatezny's full-sized avatar

Paul Statezny paulstatezny

View GitHub Profile
@paulstatezny
paulstatezny / command-line-webservers.md
Last active August 29, 2015 13:57
Simple Webservers from the Command Line
@paulstatezny
paulstatezny / patterns-of-enterprise-application-architecture.md
Last active April 24, 2024 12:26
Notes from Patterns of Enterprise Application Architecture by Martin Fowler

Patterns of Enterprise Application Architecture

By Martin Fowler (2002)

Chapter 1: Layering

A basic example of layering: FTP < TCP < IP < Ethernet

Benefis of layering:

  • You can understand a layer without knowing much about the others.
  • Minimize dependencies.
<?php
namespace Test\;
use PHPUnit_Framework_TestCase;
class Test extends PHPUnit_Framework_TestCase
{
public function setUp()
{
@paulstatezny
paulstatezny / mkpull.fish
Last active August 29, 2015 14:02
A fish shell function for creating a pull request using hub
function mkpull
set owner (git remote -v | grep git@github.com | head -n1 | awk '{print $2}' | sed 's/.*://' | sed 's/\/.*//')
set repo (git remote -v | grep git@github.com | head -n1 | awk '{print $2}' | sed 's/.*\///' | sed 's/\.git//')
set head (git rev-parse --abbrev-ref HEAD)
if set -q argv[1]
set base $argv[1]
else
set base "develop"
end
@paulstatezny
paulstatezny / pushbranch.fish
Created June 13, 2014 18:22
A fish shell function for pushing the current (new) branch to the origin remote
function pushbranch
set branch (git rev-parse --abbrev-ref HEAD)
git push -u origin $branch
end
/** @jsx React.DOM */
'use strict';
var React = require('react');
module.exports = React.createClass({
displayName : 'Name',
render : function()
{
@paulstatezny
paulstatezny / commit.fish
Last active June 15, 2018 21:45
A fish shell function for committing in Git in a "Refs #123 - Commit message." format (Usage: `commit 'Commit message'`)
# Prefix commit message with "Refs #[PULL_NUMBER] - "
# PULL_NUMBER is derived from the branch name, which is assumed to be in one of the following formats:
# something/[PULL_NUMBER]-short-descriptive-name
# something/[GROUP_NUMBER]/[PULL_NUMBER]-short-descriptive-name
function commit
set issue (git rev-parse --abbrev-ref HEAD | cut -d / -f 3 | cut -d - -f 1 | grep "^\d*\$")
set message $argv[1]
set prefix "Refs #"
@paulstatezny
paulstatezny / gco.fish
Last active March 19, 2016 22:07
Checkout a branch by partial name match
function gco
set branch (git for-each-ref | sed -E 's/[a-zA-Z0-9]*[[:space:]]commit[[:space:]]refs\/(heads|remotes\/origin)\///g' | grep $argv[1] | head -n1)
if [ "$branch" = "" ]
echo 'Branch not found';
else
git checkout $branch;
git pull origin $branch;
end
end
@paulstatezny
paulstatezny / unit.fish
Last active August 29, 2015 14:11
Fish function to run PHPUnit
function unit
# Remove logging portion of phpunit configuration
sed -i .sedbackup 's/\<\/logging\>//g' ./phpunit.xml
sed -i .sedbackup 's/\<logging\>//g' ./phpunit.xml
rm *.sedbackup
if set -q argv[1]
vendor/bin/phpunit --filter $argv[1]
else
vendor/bin/phpunit
From 0b1b114f5824be2fd4feb26eddfbb349813971cb Mon Sep 17 00:00:00 2001
From: Paul Statezny <paulstatezny@users.noreply.github.com>
Date: Sat, 31 Jan 2015 20:49:49 -0700
Subject: [PATCH] Create new dispatcher upon dispatch.
---
lib/dispatcher.js | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/dispatcher.js b/lib/dispatcher.js