TL;DR
Create a backup:
pg_dumpall > mybackup.sql
Perform the upgrade:
sudo pg_dropcluster 9.4 main --stop
# CAVEAT: I have not run this code | |
require 'rails/generators/erb/scaffold/scaffold_generator' | |
module Erb | |
module Generators | |
class ScaffoldGenerator < Base | |
protected |
Based on these: | |
https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu | |
http://www.intridea.com/blog/2013/5/21/howto-install-setup-jenkins-ci-for-rails-projects | |
Setup an EC2 instance with Ubuntu (14.04) | |
Open port 8080 | |
Install Jenkins | |
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - |
class ApplicationController < ActionController::Base | |
def is_owner user_id | |
unless user_id == current_user.id | |
render json: nil, status: :forbidden | |
return | |
end | |
end | |
def is_owner_object data | |
if data.nil? or data.user_id.nil? | |
return render status: :not_found |
TL;DR
Create a backup:
pg_dumpall > mybackup.sql
Perform the upgrade:
sudo pg_dropcluster 9.4 main --stop
$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add bootstrap@4.0.0-beta jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
# Assume we are in your home directory | |
cd ~/ | |
# Clone the repo from GitLab using the `--mirror` option | |
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git | |
# Change into newly created repo directory | |
$ cd ~/my-repo.git | |
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks. |
class PagesController < ApplicationController | |
before_filter :login_required, :except => [ :show ] | |
# GET /pages | |
# GET /pages.xml | |
def index | |
@pages = Page.find(:all) | |
respond_to do |format| | |
format.html # index.html.erb |
# webm | |
ffmpeg -i IN -f webm -vcodec libvpx -acodec libvorbis -ab 128000 -crf 22 -s 640x360 OUT.webm | |
# mp4 | |
ffmpeg -i IN -acodec aac -strict experimental -ac 2 -ab 128k -vcodec libx264 -vpre slow -f mp4 -crf 22 -s 640x360 OUT.mp4 | |
# ogg (if you want to support older Firefox) | |
ffmpeg2theora IN -o OUT.ogv -x 640 -y 360 --videoquality 5 --audioquality 0 --frontend |
require 'carrierwave/processing/mini_magick' | |
class ImageUploader < CarrierWave::Uploader::Base | |
include CarrierWave::MiniMagick | |
IMAGE_EXTENSIONS = %w(jpg jpeg gif png) | |
DOCUMENT_EXTENSIONS = %w(exe pdf doc docm xls) | |
def store_dir | |
"files/#{model.id}" |
require 'googleauth' | |
require 'google/apis' | |
require 'google/apis/calendar_v3' | |
module GoogleMeetService | |
def self.create_google_event(event) | |
authorize_client | |
google_event = create_calendar_event(event) | |
updated_google_event = update_calendar_event(event,google_event) | |
event.update_attribute(:conference_link,updated_google_event.hangout_link) |