Skip to content

Instantly share code, notes, and snippets.

@mparker17
mparker17 / mparker17.zsh-theme
Last active October 5, 2015 21:47
My ZSH theme
PROMPT='%{$fg[yellow]%}%n%{$reset_color%}@%{$fg[blue]%}%m%{$reset_color%}:%{$fg[red]%}%2~%{$reset_color%} $(git_prompt_info)%# '
ZSH_THEME_GIT_PROMPT_PREFIX="("
ZSH_THEME_GIT_PROMPT_SUFFIX=") "
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=" ✓%{$reset_color%}"
@mparker17
mparker17 / roll.rb
Created July 19, 2012 01:36
Dice rolling
#!/usr/bin/ruby
def roll(num = 1, sides = 6, bonus = 0)
# Rand returns a number between 1 and the argument.
return (rand(sides-1) + 1 + bonus) * num;
end
# Parse a string in the following forms:
# - 1d4+1 or 1d4-1
# - d4+1 or d4-1
@mparker17
mparker17 / config
Last active February 21, 2024 01:26
$XDG_CONFIG_HOME/git
[alias]
fml = reset --hard HEAD
hist = log --pretty=format:\"%C(cyan)%h %C(green)%ad%Creset | %s %C(yellow)%d %C(magenta)[%an]\" --graph --date=short
s = status
st = status
sta = status
stat = status
statu = status
stats = status
unstage = rm --cached -r
@mparker17
mparker17 / init.vim
Last active July 10, 2022 05:39
$XDG_CONFIG_HOME/nvim
" Place at $XDG_CONFIG_HOME/nvim/init.vim
" Assumes neovim (nvim) defaults.
" Grouping based on https://neovim.io/doc/user/options.html
" 2 moving around, searching and patterns
set nostartofline
set wrapscan
set smartcase
" 4 displaying text
@mparker17
mparker17 / Debugging Drupal 7.txt
Last active November 7, 2017 16:47
Debugging Drupal — ideal breakpoint spots
Drupal 7.26:
- includes/bootstrap.inc:2336 — _drupal_error_handler() — For tracking down PHP errors, warnings, notices, etc.
- includes/form.inc:1452 — form_execute_handlers() — For tracking down issues with the Form API.
- modules/dblog/dblog.module:146 — dblog_watchdog() — For tracking down errors in the database log.
@mparker17
mparker17 / VIM Cheat Sheet.graffle
Last active December 15, 2015 10:19
My VIM cheat sheet, in OmniGraffle format.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ActiveLayerIndex</key>
<integer>0</integer>
<key>ApplicationVersion</key>
<array>
<string>com.omnigroup.OmniGraffle</string>
<string>139.15.0.171074</string>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ActiveLayerIndex</key>
<integer>0</integer>
<key>ApplicationVersion</key>
<array>
<string>com.omnigroup.OmniGraffle</string>
<string>139.15.0.171074</string>
@mparker17
mparker17 / Photoshop-to-CSS conversion notes.md
Last active January 12, 2019 18:48
My Photoshop to CSS conversion notes
@mparker17
mparker17 / 2013-05-21_09-00.md
Last active December 17, 2015 16:09
Notes from DrupalCon Portland 2013

2013-05-21 09:00 We're getting OOP wrong, and there's still time to fix it.

@msonnabaum - Performance engineer at Acquia

D8

  • Symfony componets
  • many more classes
  • still not unit testable
@mparker17
mparker17 / .drushrc.php
Last active October 12, 2018 14:50
My .drushrc.php file.
Moved to https://github.com/mparker17/drushrc