Skip to content

Instantly share code, notes, and snippets.

View ugisozols's full-sized avatar

Uģis Ozols ugisozols

View GitHub Profile
<section>
<h1>About Me</h1>
<p class="profile-picture">
<img src="/images/ugisozols.png">
</p>
<p>
Hello there! My name is Uģis Ozols and I'm a self taught Ruby/Ruby on Rails developer but lately I've caught myself flirting with JavaScript more and more.
</p>
<p>
I've been learning to code on my own since late 2009 and I'm still finding it to be the best way to spend my spare time.
@ugisozols
ugisozols / gist:5691647
Last active December 17, 2015 23:48
Adding back :meta_keywords to SeoMeta
# without https://github.com/refinery/refinerycms/pull/2285
# config/initializers/seo_meta_addon.rb
SeoMeta.class_eval do
attributes.merge! :meta_keywords => :string
end
Refinery::Page.class_eval do
attr_accessible :meta_keywords
end
# run this once
git remote add refinery git://github.com/refinery/refinerycms.git
# run this every time you want to do a rebase from remote
git pull --rebase origin refinery master
# app/decorators/engine/refinery/i18n_decorator.rb
Refinery::I18n.module_eval do
built_in_locales.merge! :az => "Azerbaijan"
end
@ugisozols
ugisozols / gist:5917814
Created July 3, 2013 13:23
Middleware which speeds up Rails dev for apps with lots of assets
# turbo dev by Sam Saffron
# http://discuss.emberjs.com/t/what-are-people-doing-about-the-gazzillion-file-problem/1006/8
module Middleware
# this class cheats and bypasses rails altogether if the client attempts
# to download a static asset
class TurboDev
def initialize(app, settings={})
@app = app
end
@ugisozols
ugisozols / gist:5955777
Last active December 19, 2015 12:38
Refinery::Pages::MenuPresenter guide draft

Additional menus

This guide will show you how to:

  • configure and use Refinery::Pages::MenuPresenter
  • use a decorator to add custom method to Refinery::Page class

endprologue.

Background

@ugisozols
ugisozols / gist:5983776
Last active December 19, 2015 16:29
DRAFT! Refinery CMS 2.1.0 upgrade guide

Upgrading from version 2.0.10 to version 2.1.x

This guide will guide you through the upgrade process from version 2.0.10 to version 2.1.×.

endprologue.

WARNING. This guide assumes that you will be upgrading from version 2.0.10 of Refinery CMS. If your application is not up-to-date we strongly recommend for you to upgrade it to version 2.0.10 before trying to upgrade to version 2.1.0.

WARNING. Before continuing make sure you have a backup copy of your application and database in case something goes wrong.

@ugisozols
ugisozols / gist:5998256
Last active December 19, 2015 18:19
Refinery CMS long index name fix when upgrading from 2.0.x to 2.1.x
class RemoveMetaKeywordsFromSeoMeta < ActiveRecord::Migration
def up
with_index_name_fix do
remove_column :seo_meta, :meta_keywords
end
end
def down
add_column :seo_meta, :meta_keywords, :string
end
@ugisozols
ugisozols / gist:6002320
Created July 15, 2013 18:42
What's new/changed/removed in Refinery CMS 2.1.0

What’s new, changed and removed in version 2.1.0

This guide will provide a list of bullet points of the stuff that has been added, changed and removed in version 2.1.0.

endprologue.

Changes in behaviour

WARNING. Starting from 2.1.0 we dropped support for Ruby 1.8.×. 1.9.3 is the lowest version of
Ruby that is accepted. We strongly recommend upgrading if you’re still on 1.8.×.

diff --git a/pages/app/controllers/refinery/pages_controller.rb b/pages/app/controllers/refinery/pages_controller.rb
index d4d6dbf..b6526f0 100644
--- a/pages/app/controllers/refinery/pages_controller.rb
+++ b/pages/app/controllers/refinery/pages_controller.rb
@@ -10,7 +10,7 @@ module Refinery
# This action is usually accessed with the root path, normally '/'
def home
- render_with_templates?
+ render_with_templates?(page, :template => "refinery/pages/home")