Skip to content

Instantly share code, notes, and snippets.

@becker1701
becker1701 / pry_show_method_issue.txt
Created February 20, 2017 17:21
Pry console error when calling show-method on PG::Result object
[1] pry(main)> require 'pg'
=> true
[2] pry(main)> db = PG.connect(dbname: 'lesson_4')
=> #<PG::Connection:0x007f9701eb2950>
[3] pry(main)> results = db.exec('SELECT * FROM films;')
=> #<PG::Result:0x007f9705bdb908 status=PGRES_TUPLES_OK ntuples=10 nfields=6 cmd_tuples=10>
[4] pry(main)> results.fields
=> ["title", "year", "genre", "duration", "director_id", "id"]
[5] pry(main)> results.values
=> [["Die Hard", "1988", "action", "132", "1", "1"],
module Hands
# Actions is mixed into Hand class
# @cards is a Hand instance variable that is an array of Card objects
module Actions
def hit(stock)
def double(stock)
def split(player, stock)
end
module Compare
@becker1701
becker1701 / post.rb
Created November 19, 2015 18:54
Category slugify plugin for Jekyll 3.0.0: This plugin will slugify the categories listed in the YML frontmatter. Categories with multiple words will have the spaces replaced with dashes. Put this file in the _plugins directory.
module Jekyll
class Document
#Updated for Jekyll 3.0.0
# override post method in order to return categories names as slug
# instead of strings
#
# An url for a post with category "category with space" will be in