How-To: Reset WordPress Database to Default Settings

Easily Reset WordPress Database

WordPress Database Reset is a WordPress plugin I recently came across that will at some point prove very, very useful to me.

It’s not often that I need to reset a production WordPress database to it’s default settings, but this plugin will make the task a whole lot easier. Chris Berthe, the author, describes the plugin like this:

WordPress Database Reset is a secure and easy way to reinitialize your WordPress database back to its default settings without actually having to reinstall WordPress yourself.

I can see this being crazy useful for WordPress plugin and theme developers. We frequently need a fresh database to work with, so I’ll be adopting this plugin in my WordPress plugin and theme development workflow from here on.

WordPress Database Reset requires WordPress 3.0+ and can be installed just like any other WordPress plugin. It’s in the WordPress Plugin directory, and can also be found on GitHub.

It even integrates with WP-CLI, a command line tool for interacting with WordPress. This allows you to do things like select which tables you want to reset:

wp reset database --tables='users, posts, comments, options'

Here’s a list of features:

  • Extremely fast one click process to reset the WordPress database
  • Choose to reset the entire database or specific database tables
  • Secure and super simple to use
  • Prefer the command line? Reset the database in one command
  • Excellent for theme and plugin developers who need to clean the database of any unnecessary content quickly

If you’re a WordPress theme or plugin developer, you should definitely check it out.

0

More Responsive Tables

More Responsive Tables, for Twitter Bootstrap this time, but not necessarily. From @nadangergeo & @filamentgroup!

I made a post the other day about the responsive table plugins provided by TableSaw. They’re nice, but if you’re using Twitter Bootstrap (like I and many, many others do), RWD-Table Patterns may suit you better. There’s a demo here.

It’s mobile first, and is made with Twitter Bootstrap, although you can remove Bootstrap in your own fork if you wish. Usage instructions can be found at the demo page, and at the the GitHub repository.

A list of features:

Made for Twitter Bootstrap

Designed to be used with Bootstrap 3. If you don’t want to use bootstrap, just fork the repo and customize it to your needs!

Mobile first & PE

Built with mobile first and progressive enhancement in mind. Also built with love and with the help of a fair amount of coffee.

Graceful JS fallback

In browsers without JavaScript, the tables will still be scrollable. I.e. there’s still some responsiveness.

Easy to use

You only need to add one JS-file, one CSS-file and some minimal setup to make the tables responsive. Dependencies: jQuery and Twitter Bootstrap 3.

If you’re really in need of responsive tables, this could be another option for you, so it’s at least worth knowing about and checking out.

0

New Sublime Text Themes: am​Coder and Minimal Sublime Text

So many themes and color schemes

These aren’t exactly new, but I’ve been around the Sublime Text theme scene for a while and I’d never seen these two. So, here you go!

amCoder

amCoder describes itself as a “Hyperminimal UI Theme for Sublime Text 2/3 with Love of Monokai.” It’s based on Spacegray, and is optimized for Monokai.

amCoder can be installed via Package Control and can also be found on GitHub. Here’s a screenshot of the amCoder Sublime Text theme:
amCoder

Minimal Sublime Text

Minimal Sublime Text is a flat version of the default Sublime Text theme. That’s probably why I like it so much.

It also comes with a dark sidebar version and can be installed via Package Control. Imagine that. :) Minimal Sublime Text is available on Github as well. A screenshot of Minimal Sublime Text is below:
minimal

Here’s some other recent posts about Sublime Text themes:

  1. Brogrammer Theme
  2. Predawn
  3. Spacefunk
  4. Flatland
  5. A bunch of others
0

Responsive HTML Tables

Responsive HTML Tables with TableSaw

HTML tables have fallen out of favor over the past few years. People seem to use grids where a plain HTML table would really work much better. This is especially true when displaying data, like you’d find in a spreadsheet.

Enter TableSaw, a group of plugins for responsive tables. There are various modes, the featured image for this post is a preview of the Stack mode.

There are many other modes to choose from, too.

To get you started quickly, there’s a Stack-Only TableSaw, it’s barebones and doesn’t include the other modes. Here’s a demo of the Stack-Only TableSaw.

For usage instructions for the full TableSaw, look towards the bottom of the README on GitHub. You basically are just including a few CSS and JavaScript files.

0

How-To: Install lolcommits On Ubuntu

Lolcat-style photos as you commit

I’ve always had problems installing lolcommits on Xubuntu and other Ubuntu-based Linux distributions.

The installation instructions are very simple. Only requiring you to run two commands, sudo apt-get install mplayer imagemagick libmagickwand-dev and then sudo gem install lolcommits (need sudo for linux). Pretty simple.

The gem install lolcommits command is where things usually go bad for me. I typically see something like this:

tyler@echo:~$ sudo gem install lolcommits
Building native extensions.  This could take a while...
ERROR:  Error installing lolcommits:
	ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from extconf.rb:1:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/oj-2.0.14 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/oj-2.0.14/ext/oj/gem_make.out

To fix this, you need to install a newer ruby-dev package:

sudo apt-get install ruby1.9.1-dev

You can now try to install the lolcommits gem again. It’ll actually install this time:

gem install rdoc
gem install lolcommits

A GitHub user documented this solution in issue #54. Another user suggests that the installation guide should be updated to make a note of this, but I haven’t seen it noted anywhere but in issue #54.

It’d sure save me a bit of time if it was noted somewhere, that’s partly why I’m writing this post.

After you’ve got lolocommits installed, see the README on GitHub for usage instructions and examples.

I usually run lolcommits --enable --delay=2 --fork when enabling lolcommits. That will capture a photo in a forked process, after a 2 second delay. I like this method because you’re not left waiting for the photo before being able to type into your terminal again.

Lolcommits is kinda cool, but not really useful in a practical sense. I do use it pretty much everywhere though, and have the default storage location linked to Copy. That way all my images are in the same place, no matter which machine I’m using at home.

If nothing else, it’s something kinda neat to be able to offer to your clients.

tyler-hat-lolcommits
I no longer smoke. 😉
0