Skip to content

Instantly share code, notes, and snippets.

View codfish's full-sized avatar

Chris O'Donnell codfish

View GitHub Profile
codfish /
Last active August 29, 2015 14:04
Remove an auto-complete URL from Chrome

How to remove an auto-complete URL from Chrome

Mac: highlight the entry and then press Fn + Shift + Del

PC: highlight the entry and press Shift + Delete

  • Update, 7/29/14 - From my own personal trial and error, this is only working for me on items specifically in my history, either URL's or previous Omnibox google searches, but not google's auto suggestions. To delete an item from the omnibox on mac, arrow over it and hit Fn + Shift + Del or just Shift + Del for some people it seems (not me).

Original Source

codfish /
Created July 29, 2014 17:12
Delete all local gems with this one liner. Source:
# In Ruby 2.0 there are protected default gems that wont get uninstalled by this.
$ for i in `gem list --no-versions`; do gem uninstall -aIx $i; done
sudo dseditgroup -o edit -a <username> -t user <groupname>
codfish / wp-cli.local.yml
Last active August 29, 2015 14:04
With commands you'll be using regularly, you can store your standard arguments in your wp-cli.local.yml file. Given a wp-cli.local.yml file like this, a command like this: `wp core install --title="WordPress Trunk" --url= --admin_user=daniel --admin_password=daniel` ... becomes as easy …
# source:
core install:
title: WordPress Trunk
admin_user: daniel
admin_password: daniel
codfish /
Created August 4, 2014 13:42
Ever type a command and forget/didn't know you need sudo, and get a permission denied error? Rather than re-type, or press up and go to front of the line, here's a slightly quicker way to rerun the last command as sudo.
$ sudo !!
codfish /
Created August 8, 2014 13:23
Get the directory in bash of the script that's running. It's a useful one-liner which will give you the full directory name of the script no matter where it is being called from.
# source:
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
codfish /
Created August 12, 2014 13:20
Search & replace strings in Wordpress databases easily with wp-cli (
wp search-replace '' ''
codfish /
Created August 12, 2014 15:19
Import mysql dump file via command line
mysql -u<username> -p<password> <dbname> < /path/to/sqldumpfile.sql
codfish / apache_RewriteCond.conf
Created August 14, 2014 19:06
The RewriteCond directive just describes an additional condition for a RewriteRule directive. So RewriteCond must always be associated with a RewriteRule. Source:
; Now this rule is applied if the pattern of the RewriteRule matches the current request
; URL (per-directory path stripped before) and if the condition is fulfilled.
; In this case the condition is only true if when mapping the request URL
; to the filesystem it matches either an existing file with the file size
; greater than 0 (-s), or a symbolic link (-l) or a directory (d). So your rule will
; be applied for any URL (^.*$ matches anything) that can be mapped to something
; existing in your filesystem. The substitution - just means to not change anything.
; And the NC (no case, case insensitive, useless in this context) and L (last rule if applied)
; are flags that modify either the pattern, replacement or the execution of the rule.
codfish / app.js
Last active August 29, 2015 14:06
AngularJS Breadcrumbs leveraging ui-router's states. Based off
'use strict';
* App Module
* @note
* ui-router setup is def incomplete. this is just to show an
* example of the breadcrumb setup
* @ngInject