Skip to content

Instantly share code, notes, and snippets.

View codfish's full-sized avatar

Chris O'Donnell codfish

View GitHub Profile
@codfish
codfish / rm_autocomplete_chrome.md
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
codfish / rm_local_gems.sh
Created July 29, 2014 17:12
Delete all local gems with this one liner. Source: http://stackoverflow.com/a/8095234
# 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
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=http://wordpress-trunk.dev --admin_user=daniel --admin_password=daniel --admin_email=daniel@handbuilt.co` ... becomes as easy …
# source: https://github.com/danielbachhuber/wp-dev-docs/blob/master/performance/migrations.md
core install:
title: WordPress Trunk
url: http://wordpress-trunk.dev
admin_user: daniel
admin_password: daniel
admin_email: daniel@handbuilt.co
@codfish
codfish / rerun_as_sudo.sh
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
codfish / cur_file_directory.sh
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: http://stackoverflow.com/a/246128
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@codfish
codfish / wp_search_replace.sh
Created August 12, 2014 13:20
Search & replace strings in Wordpress databases easily with wp-cli (http://wp-cli.org/)
wp search-replace 'local.example.com' 'www.example.com'
@codfish
codfish / mysql_import.sh
Created August 12, 2014 15:19
Import mysql dump file via command line
mysql -u<username> -p<password> <dbname> < /path/to/sqldumpfile.sql
@codfish
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: http://stackoverflow.com/a/2102189
; 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
codfish / app.js
Last active August 29, 2015 14:06
AngularJS Breadcrumbs leveraging ui-router's states. Based off http://goo.gl/w0zFou
'use strict';
/**
* App Module
*
* @note
* ui-router setup is def incomplete. this is just to show an
* example of the breadcrumb setup
*
* @ngInject