Skip to content

Instantly share code, notes, and snippets.

View jendiamond's full-sized avatar
🏠
Working from home

JenDiamond jendiamond

🏠
Working from home
View GitHub Profile
class House
  def recite
    (1..pieces.length).map {|i| line(i)}.join("\n")
  end

  def line(number)
    "This is %s.\n" % pieces.last(number).join(' ')
  end
@jendiamond
jendiamond / 0_user_endpoints.md
Last active April 13, 2016 00:59
sarcastic_messages_tutorial

Jen Diamond

  • GET api/v1/users (index)
  • POST api/v1/users (create)
  • PUT api/v1/users (update)
  • GET api/v1/users/:id (show)

Don't forget tests :)

If I want to use Postgres as database:

$ rails new funclub --database=postgresql



These are the gems I use for most of my apps.

Objects for Advanced Living

  • wedge
  • salt
  • purse hanger
  • hairtie
  • gum
  • earphones
  • flash drive
  • business card

Date / Time Pickers

intialize it first

views/jobby_jobs/show.html.erb
.strftime("%a, %b %d")

views/jobby_jobs/index.html.erb
.strftime("%a, %b %d, %y")

Add RSpec

group :test do
  gem 'rspec-rails', '~> 3.4', '>= 3.4.2'
end

$ rails generate rspec:install

@jendiamond
jendiamond / map.md
Last active March 18, 2016 07:09 — forked from kkchu791/map.md

Add a Map

We are going to setup a map feature that will allow you to see all your adventures on a map and search for adventures by address.

First let’s setup our migrations

Setup an address column

In your command line, generate the migrations for address, latitutde and longitude.

@jendiamond
jendiamond / S3.md
Last active March 18, 2016 22:57 — forked from kkchu791/S3.md
Persisting Images

AWS- Setting up Carrierwave for S3

It's time to setup your AWS bucket so your photos can persist on the internet. Instead of pushing photos to your local machine, you will be pushing them to an Amazon Web Service cloud.

You will need your credit card for doing this. It's free to use but be forewarned, be careful not to push your AWS credentials up to any public domains or somebody could use your credit card.

Before we begin let's get our app setup for Amazon Web Services(AWS):

###Adding Fog Gem and Carrierwave Configs

Coding Challenges

Write a method that:


1) Returns the longest word in a sentence (“The dog ran into the shoe store” )

(Optional: “The dog ran into the shoe store.”)