Skip to content

Instantly share code, notes, and snippets.

@jtwalters
jtwalters / settings.php
Created July 21, 2014 20:00
Suggested by mikeytown2 for faster Drupal DB
<?php
/**
* Suggested by mikeytown2 for faster DB
* @see https://www.drupal.org/node/1650930#comment-8437127
*/
/* -- Delete this line if you want to use this
$databases['default']['default']['init_commands'] = array(
'isolation' => "SET SESSION tx_isolation='READ-COMMITTED'"
);
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.restart='nginx.stop && nginx.start'
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php53.plist"
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php53.plist"
alias php-fpm.restart='php-fpm.stop && php-fpm.start'
alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist"
alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist"
@jtwalters
jtwalters / omghosts
Last active August 29, 2015 14:02 — forked from angrytoast/omghosts
#! /usr/bin/env bash
PROBLEM="$(cat /etc/hosts | grep tableausoftware.com | grep -v '^#' | wc -w)"
SAY=${1:-"omg fix yer hosts"}
if [ "$PROBLEM" -gt 0 ]; then
say $SAY
fi
@jtwalters
jtwalters / JOKES.md
Last active August 29, 2015 14:02
Programming Jokes

Comment your jokes below in the following format:

Question?

Answer

@jtwalters
jtwalters / install.sh
Last active August 29, 2015 14:02
Download and install Drupal 7 (MAMP on OS X)
drush dl drupal \
--destination=/Applications/MAMP/htdocs \
--drupal-project-rename=d7
cd /Applications/MAMP/htdocs/d7
drush site-install standard \
--db-url="mysql://root:root@localhost/d7"\
--site-name="d7"
@jtwalters
jtwalters / git-grepwords
Last active July 19, 2016 09:11
Grep multiple words in your git commit message history
# Example use: find commit messages that contain pattern1 and pattern2
# $ git grepwords pattern1 pattern2
# Ensure we have at least one param (a pattern)
[ -n "$1" ] || { echo "usage: $0 PATTERN..." >&2; exit 1; }
pattern=""
# Append all remaining patterns
while [ -n "$1" ]; do
@jtwalters
jtwalters / say.txt
Last active August 29, 2015 14:01
Caboose sayings
-v hysterical caboose is the best thing since sliced bread
@jtwalters
jtwalters / gist:68e36077218b3b5e25b4
Last active August 29, 2015 14:01
GitHub Release Notes Print Bookmarklet
javascript:(function($) { $('.header, .pagehead, .repository-sidebar, .release-authorship, .release-meta, .section-heading, .release-downloads, .site-footer').hide(); $('.release-show, .release-body').css('border', 'none'); window.print(); })(jQuery);
Hi there,
Sorry to hear you’re having trouble with our form. From what you are describing, it sounds like you might have cookies disabled in your web browser. Our registration form requires cookies to be enabled for our site in order for us to “remember” that you have filled out the form and can access premium content such as our free training videos. Would you mind trying to enable cookies for our website and then fill out the form just one more time?
Apologies for the inconvenience and let me know if you have any further questions or issues.
@jtwalters
jtwalters / gist:11189634
Created April 22, 2014 18:32
Delete remote GitHub pull branches
git for-each-ref --format="%(refname:short)" refs/remotes/origin/pr/\* | xargs git branch -d -r