Skip to content

Instantly share code, notes, and snippets.

Chris O'Donnell codfish

Block or report user

Report or block codfish

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@codfish
codfish / rm_autocomplete_chrome.md
Last active Aug 29, 2015
Remove an auto-complete URL from Chrome
View rm_autocomplete_chrome.md

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 Jul 29, 2014
Delete all local gems with this one liner. Source: http://stackoverflow.com/a/8095234
View rm_local_gems.sh
# 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
View add_user_to_group_osx.sh
sudo dseditgroup -o edit -a <username> -t user <groupname>
@codfish
codfish / wp-cli.local.yml
Last active Aug 29, 2015
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 …
View wp-cli.local.yml
# 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 Aug 4, 2014
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.
@codfish
codfish / cur_file_directory.sh
Created Aug 8, 2014
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.
View cur_file_directory.sh
# source: http://stackoverflow.com/a/246128
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@codfish
codfish / wp_search_replace.sh
Created Aug 12, 2014
Search & replace strings in Wordpress databases easily with wp-cli (http://wp-cli.org/)
View wp_search_replace.sh
wp search-replace 'local.example.com' 'www.example.com'
@codfish
codfish / mysql_import.sh
Created Aug 12, 2014
Import mysql dump file via command line
View mysql_import.sh
mysql -u<username> -p<password> <dbname> < /path/to/sqldumpfile.sql
@codfish
codfish / apache_RewriteCond.conf
Created Aug 14, 2014
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
View apache_RewriteCond.conf
; 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 / unload_apache.sh
Last active Aug 29, 2015
Stop apache permanently on mac Mavericks. This will stop a running instance of Apache, and record that it should not be restarted. It records your preference in /private/var/db/launchd.db/com.apple.launchd/overrides.plist. http://goo.gl/J26slP
View unload_apache.sh
# ** you need to have an apache instance running already for this command to work.
sudo apachectl start
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
You can’t perform that action at this time.