Skip to content

Instantly share code, notes, and snippets.

@ivan22
ivan22 / 0_reuse_code.js
Created July 18, 2014 10:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

These are steps to setup a new project in ROR.
You must configure and install your Gems individually instead of copying the Gemfile from a previous project.

Refer to Heroku setup if you want to push your project to Heroku.

Setup directory

# Create directory in ~/workspace
mkdir ./testproject
cd ./testproject
@ivan22
ivan22 / Gemfile
Created June 5, 2014 03:58 — forked from cblunt/Gemfile
Carrierwave S3 Amazon
# ...
gem 'carrierwave'
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL
@ivan22
ivan22 / share_meta.md
Last active August 29, 2015 14:02
Meta tag for share button

for Google

<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="" />
<meta name="copyright" content="" />
<meta name="application-name" content="" />

for Facebook.

@ivan22
ivan22 / Paperclip.md
Created May 17, 2014 03:25
Paperclip Gem for uploading of attachment

Setup

  • Install the gem gem "paperclip", "~> 3.0"
# Create Database
class AddPhotoToDeals < ActiveRecord::Migration
  def self.up
    add_attachment :deals, :photo
  end
@ivan22
ivan22 / Arrays.md
Created May 17, 2014 03:23
List of array functions
@ivan22
ivan22 / FactoryGirl.md
Created May 17, 2014 03:17
Factory Girl
@ivan22
ivan22 / countries.md
Created May 17, 2014 03:17
Country gem

Gemfile

gem 'countries'

View

= select_tag(:country, options_for_select(Country.all))
@ivan22
ivan22 / Simple Form.md
Created May 17, 2014 03:16
Simple Form

Gemfile

gem 'simple_form'

Installation

rails generate simple_form:install
@ivan22
ivan22 / Robots.md
Created May 17, 2014 03:15
Robots.txt setup

To edit the robots.txt file, simply go to public/robots.txt and edit it.