Skip to content

Instantly share code, notes, and snippets.

@titaniumtails
titaniumtails / pg & mysql cli commands.md
Last active August 29, 2015 14:09
PostgreSQL & mySQL CLI commands

###Useful PG & MYSQL command line interface commands:

database enter CLI exit CLI table databases change databases columns describe
mysql mysql exit SHOW TABLES SHOW DATABASES use database_name SHOW COLUMNS DESCRIBE TABLE
postgresql psql \q \d \l \c database_name \d table \d+ table

To check our port is up and running with Postgres:

@titaniumtails
titaniumtails / Ruby Gems I love.md
Last active August 29, 2015 14:08
Really Useful Ruby Gems.md

##Essential Gems I love

##Index GENERAL

gem 'autoprefixer-rails'
gem 'bootswatch-rails'
gem 'bourbon'
gem 'country_select'
gem 'carrierwave'
# .../app/assets/javascripts/places_show.js.coffee
PlaceShow =
initialize: (opts) ->
#*******************************************************************************************
# INITIALIZERS
#*******************************************************************************************
isCalendarOpen = false
@.initializePanoramas()
@.initializeSlider()
@.initializeSharePlace(opts.share_title, opts.share_url, opts.share_id)

Nested Resources

This has been forked from Harry's documentation on Nested Resources.

This is for when you have Associated models. In this case, we have a Post & Comment model. This is how we associate it:

class Post < ActiveRecord::Base
  has_many :comments
end