Skip to content

Instantly share code, notes, and snippets.

View francelwebdev's full-sized avatar

FrancelWebdev francelwebdev

View GitHub Profile
@francelwebdev
francelwebdev / deploying_rails_to_heroku.md
Created January 18, 2018 17:14 — forked from thebucknerlife/deploying_rails_to_heroku.md
A Beginners Guide to Deploying a Rails App on Heroku

Deploying to Heroku

This guide is for a first-time Rails developer to deploy their app to Heroku, a popular web-hosting service with strong Rails support. This guide assumes you already have a Heroku account and have installed the Heroku Toolbelt.

Create Your App and Setup Heroku with Git

  1. Make sure you've setup an SSH key for Heroku. Follow this simple guide to create an SSH key and send it to Heroku if needed: Heroku: Managing Your SSH Keys
  2. Navigate into the folder for your Rails app.
@francelwebdev
francelwebdev / Install_pgAdmin4_with_python3_on_Ubuntu 16.04.md
Created February 8, 2018 10:41 — forked from Prototype-X/Install_pgAdmin4_with_python3_on_Ubuntu 16.04.md
Install pgAdmin4 v2.0 with python3 on Ubuntu 16.04 DESKTOP mode

Install pgAdmin4 v2.0 with python3 on Ubuntu 16.04 DESKTOP mode

  1. Get Python Wheel pgAdmin4

     wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v2.0/pip/pgadmin4-2.0-py2.py3-none-any.whl
    
  2. Install pip3

     sudo apt install python3-pip
    
@francelwebdev
francelwebdev / add_locale_to_users.rb
Created February 11, 2018 19:42 — forked from Bahanix/add_locale_to_users.rb
Ruby on Rails i18n: using user locale
# db/migrates/*_add_locale_to_users.rb
class AddLocaleToUsers < ActiveRecord::Migration
def change
add_column :users, :locale, :string, default: "fr"
end
end
@francelwebdev
francelwebdev / Rails-applications-health-codes.md
Created February 11, 2018 20:18 — forked from kathyonu/Rails-applications-health-codes.md
Rails Applications Upgrade Steps for Ruby, Rails and Gems

Commands to keep your app healthy, Ruby and Rails gems wise.
Each command is described further below.
Open new Terminal, note the gemsets showing:

rvm gemset list

You will see you are using the (default) gemset.
Keep your system up to date with rvm and brew:

rvm get stable

@francelwebdev
francelwebdev / restful_routes.md
Created February 15, 2018 10:22 — forked from alexpchin/restful_routes.md
7 Restful Routes
URL HTTP Verb Action
/photos/ GET index
/photos/new GET new
/photos POST create
/photos/:id GET show
/photos/:id/edit GET edit
/photos/:id PATCH/PUT update
/photos/:id DELETE destroy
@francelwebdev
francelwebdev / attachinary_setup.md
Created February 26, 2018 15:25 — forked from ssaunier/attachinary_setup.md
Attachinary Setup in Rails 5

Attachinary Setup

First add the following gems to your Gemfile:

# Gemfile
gem "attachinary"
gem "jquery-fileupload-rails"
gem "coffee-rails"
@francelwebdev
francelwebdev / ubuntu-xenial-remove-amp.sh
Created April 15, 2018 10:59 — forked from jasperf/ubuntu-xenial-remove-amp.sh
Remove Apache, MySQL and PHP 7 on Ubuntu Xenial #php #ubuntu #lamp
sudo apt remove apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php libapache2-mod-php7.0 php7.0-mysql php7.0-opcache php7.0-readline mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server mysql-server-5.7 mysql-server-core-5.7 php-mysql php7.0-mysql php-common php-mysql php7.0-cli php7.0-common php7.0-json
@francelwebdev
francelwebdev / heroku_pg_db_reset.md
Created May 15, 2018 12:59 — forked from zulhfreelancer/heroku_pg_db_reset.md
How to reset PG Database on Heroku?

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

heroku restart; heroku pg:reset DATABASE --confirm APP-NAME; heroku run rake db:migrate

@francelwebdev
francelwebdev / hosting-on-github.md
Created November 23, 2018 12:26 — forked from TylerFisher/hosting-on-github.md
Basic steps for hosting on Github

Steps for Hosting a Website on GitHub

  1. Create a GitHub account on github.com.
  2. Download either [GitHub for Mac][1] or [GitHub for Windows][2], depending on your operating system. Open the app and log in using the account you just created.
  3. (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
  4. Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
  5. Move your website's files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level directory.
  6. Back in the GitHub application, you should see your files in the left column. Make sure they are all checked. If so, enter a mess
@francelwebdev
francelwebdev / admin.html.erb
Created April 29, 2019 11:26 — forked from carlosramireziii/admin.html.erb
"Best Practices For Building A Rails Admin Interface From Scratch" sample setup
<% # app/views/layouts/admin.html.erb %>
<!DOCTYPE html>
<html>
<head>
<title>Admin Interface</title>
<%= csrf_meta_tags %>
<% # Optionally use admin-specific assets here instead of the normal application assets %>
<%= stylesheet_link_tag 'admin', media: 'all', 'data-turbolinks-track': 'reload' %>