This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/models/page.rb | |
class Page < ActiveRecord::Base | |
validates :translations, presence: :true | |
translates :name, :content | |
accepts_nested_attributes_for :translations, allow_destroy: true | |
mount_uploader :image, ImageUploader | |
def to_param |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install RVM | |
\curl -L https://get.rvm.io | bash -s stable | |
source /etc/profile.d/rvm.sh | |
# Install Ruby | |
rvm install 2.0.0 | |
# Install passenger | |
gem install passenger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update passenger | |
gem update passenger | |
# Show available passengers | |
gem list passenger | |
# Uninstall old passengers | |
gem uninstall passenger -v 4.0.18 | |
# Install new Apache module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open ISPConfig and setup Apache on your domain | |
DocumentRoot /var/www/domain.tld/web/current/public | |
PassengerPreStart http://domain.tld/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Last login: Fri Oct 11 11:34:49 on ttys002 | |
jiris-imac:errbit jirikolarik$ cap deploy:setup deploy db:create_mongoid_indexes | |
* 2013-10-11 11:35:43 executing `deploy:setup' | |
* executing "mkdir -p /var/www/errbit2 /var/www/errbit2/releases /var/www/errbit2/shared /var/www/errbit2/shared/system /var/www/errbit2/shared/log /var/www/errbit2/shared/pids" | |
servers: ["errbit.imin.cz"] | |
Password: | |
[errbit.imin.cz] executing command | |
command finished in 169ms | |
* executing "chmod g+w /var/www/errbit2 /var/www/errbit2/releases /var/www/errbit2/shared /var/www/errbit2/shared/system /var/www/errbit2/shared/log /var/www/errbit2/shared/pids" | |
servers: ["errbit.imin.cz"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyEngine::Engine.routes.draw do | |
devise_scope :user do | |
providers = Regexp.union(Devise.omniauth_providers.map(&:to_s)) | |
match 'users/auth/:provider', | |
constraints: { provider: providers }, | |
to: 'omniauth_callbacks#passthru', | |
as: :omniauth_authorize, | |
via: [:get, :post] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Missing | |
def new_method | |
# Do something | |
end | |
def override_method this_should_be_false = false | |
super | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VideoUploader < CarrierWave::Uploader::Base | |
include ::CarrierWave::Backgrounder::Delay | |
include CarrierWave::FFmpeg | |
RESOLUTIONS = [ | |
{ version: :p1080, resolution: '1920x1080'}, | |
{ version: :p720, resolution: '1280x720'} | |
] | |
# Choose what kind of storage to use for this uploader: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psql: could not connect to server: No such file or directory | |
Is the server running locally and accepting | |
connections on Unix domain socket "/tmp/.s.PGSQL.5432"? | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
rm /usr/local/var/postgres/postmaster.pid | |
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"code": "ab", | |
"name": "Abkhaz" | |
}, | |
{ | |
"code": "aa", | |
"name": "Afar" | |
}, | |
{ |
OlderNewer