Skip to content

Instantly share code, notes, and snippets.

@ianjamieson
ianjamieson / .bashrd
Last active January 28, 2023 22:02
A few useful git aliases for your command line
alias gs="git status"
alias git-status-file='function _git_file(){ git diff --name-only | sed -n ${1}p };_git_file'
alias gsf="git-status-file"
alias gcp1="gsf 1 | pbcopy"
alias ga="git add"
@ianjamieson
ianjamieson / sometest.spec.ts
Last active October 8, 2018 13:47
Observables Testing
describe('Observables Example', () => {
// set up observable
let observable: Observable<any>;
// mock the return value from the form
const formValue: string = 'United Kingdom';
it('should match observable', () => {
// create a mock observable, which triggers once and returns the formValue. This is effectively
// like triggering a form change
@ianjamieson
ianjamieson / .screenrc
Created August 21, 2018 09:18
Boilerplate Screen configuration
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
@ianjamieson
ianjamieson / virtualhost.conf
Last active March 13, 2017 23:31
Simple Virtual Hosts Boilerplate, primarily used for WordPress installs
# Start the Virtual Host block, apply for all traffic on port 80
<VirtualHost *:80>
# The document root is where the project files will be saved on your computer, ensure that Apache can read from this directory
DocumentRoot "/path/to/doc/root"
# The server name is what you type in your browser to access the site, this will also need to be set up in your hosts file
ServerName yoursitename.dev
# If you are interested in tailing error logs, then you can specify a file to output these logs to
ErrorLog "/private/var/log/apache2/yoursitename.dev-error_log"
# As above, but this is for all requests, not errors
CustomLog "/private/var/log/apache2/yoursitename.dev-access_log" common