Skip to content

Instantly share code, notes, and snippets.

View kritik's full-sized avatar

Vladimir Krylov kritik

  • PerfectLine
  • Tallinn, Estonia
View GitHub Profile
@kritik
kritik / gist:5196475
Created March 19, 2013 14:19
god config
# == God config file
# http://god.rubyforge.org/
# Author: Gump
#
# fixed thin ports <[email protected]>
#
# Config file for god that configures watches for each instance of a thin server for
# each thin configuration file found in /etc/thin.
require 'yaml'
@kritik
kritik / schema.xml
Created November 4, 2011 19:31
tomcat-pruction solr config
<?xml version="1.0" encoding="UTF-8" ?>
<!-- from jetty-solr https://github.com/dcrec1/jetty-solr/blob/master/solr/conf/schema.xml -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
@kritik
kritik / gist:1256399
Created October 1, 2011 17:47 — forked from crosebrugh/gist:1128448
Using nested_form_for with rails_admin
class Product < ActiveRecord::Base
has_many :material_product_mappings, :dependent => :destroy, :inverse_of => :product
has_many :materials, :through => :material_product_mappings, :autosave => true
accepts_nested_attributes_for :material_product_mappings # really needed feature
#...
end
@kritik
kritik / gist:1037898
Created June 21, 2011 13:54
Refinerycms-images preview test scenario
Scenario: Show preview textarea if prewiev is allowed
Given I have news items titled Home, About
And I have setting "Refinery News Show Preview" allowed
When I go follow "Home"
Then I should see "Preview text"
<?php
/**
* Hello Controller for Hello World Component
*
* @package VladimirKrylov
* @subpackage Components
* @license GNU/GPL
*/
// No direct access
# controller from http://diamond.cyprus-city.com/travels
class TravelsController < ApplicationController
before_filter :find_all_travels
before_filter :find_page
def index
# you can use meta fields from your model instead (e.g. browser_title)
# by swapping @page for @travel in the line below:
/home1/cyprusci/rails_apps/diamond/config/boot.rb:110: warning: method redefined; discarding old run
Exception `LoadError' at /usr/lib64/ruby/site_ruby/1.8/rubygems.rb:1113 - no such file to load -- rubygems/defaults/operating_system
Exception `LoadError' at /usr/lib64/ruby/site_ruby/1.8/rubygems/config_file.rb:50 - no such file to load -- Win32API
Exception `LoadError' at /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31 - no such file to load -- bundler
Exception `NoMethodError' at /usr/lib64/ruby/1.8/rational.rb:78 - undefined method `gcd' for Rational(1, 2):Rational
/home1/cyprusci/rails_apps/diamond/vendor/plugins/refinery/lib/refinery.rb:5: warning: method redefined; discarding old is_a_gem
/home1/cyprusci/rails_apps/diamond/vendor/plugins/refinery/lib/refinery.rb:9: warning: method redefined; discarding old root
/home1/cyprusci/rails_apps/diamond/vendor/plugins/refinery/lib/refinery.rb:13: warning: method redefined; discarding old s3_backend
/home1/cyprusci/rails_apps/diamond/vendor/plugins/r
source :rubygems
# Specify the database driver as appropriate for your application (only one is necessary).
# Defaults to sqlite3. Don't remove any of these below in the core or gems won't install.
#gem 'sqlite3-ruby', :require => 'sqlite3' #db_adapter=sqlite3
gem 'mysql', :require => 'mysql'#, :db_adapter=>:mysql
# gem 'pg' #db_adapter=postgresql
# Specify your favourite web server (only one) - not required.
# gem 'unicorn', :group => :development