Skip to content

Instantly share code, notes, and snippets.

View jenheilemann's full-sized avatar

Jen Heilemann jenheilemann

View GitHub Profile

##Cursor movement

  • h - move left
  • j - move down
  • k - move up
  • l - move right
  • w - jump by start of words (punctuation considered words)
  • W - jump by words (spaces separate words)
  • e - jump to end of words (punctuation considered words)
  • E - jump to end of words (no punctuation)
@jenheilemann
jenheilemann / 20130822132243_change_product_long_description.rb
Created August 22, 2013 14:39
Rails migrations: String to Text and back again. It's kind of complicated to update a database column that is currently a "string" and convert it into "text." Well, it's not hard to update the column, but it can be dangerous if you need to rollback the migration - Postgresql and other databases don't like adding a limit to the column, and the `r…
class ChangeProductLongDescription < ActiveRecord::Migration
def up
# simple and straightforward
change_column :products, :long_description, :text
end
# but why cant it just be:
# change_column :product, :long_description, :string
# ???
# because effin databases don't like you, that's why.
@jenheilemann
jenheilemann / sub-page-navigation-widget.php
Last active September 18, 2017 15:37
Controlled through the Widget menus. It adds sub-page navigation automatically
<?php
/*
Sub-Page Navigation Widget
Controlled through the Widget menus.
It adds sub-page navigation automatically.
It has no options.
*/
class SubPage_Navigation_Widget extends WP_Widget {