Skip to content

Instantly share code, notes, and snippets.

View simi's full-sized avatar
🇨🇿

Josef Šimánek simi

🇨🇿
View GitHub Profile
@simi
simi / openttd.cfg
Created November 26, 2010 12:26
retro's night build openttd cfg
[misc]
display_opt = SHOW_TOWN_NAMES|SHOW_STATION_NAMES|SHOW_SIGNS|FULL_ANIMATION|FULL_DETAIL|WAYPOINTS
news_ticker_sound = true
fullscreen = false
graphicsset =
soundsset =
musicset =
videodriver =
musicdriver =
@simi
simi / omglol
Created January 25, 2011 10:56
Opera and IE redirect source at RefineryCMS' page edit
<!DOCTYPE >
<html>
<head>
<title>WYMeditor</title>
<meta charset="undefined">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@simi
simi / win-refinery-gem
Created January 26, 2011 22:22
Refinery 0.9.9 gem install on clear railsinstaller environment
RDoc 2.5 did not save method parameters, so you should upgrade your rdoc-data
gem to a version >= 2.5.3.
To have ri data for core and stdlib you'll need to:
gem install rdoc-data
then run:
rdoc-data --install
@simi
simi / win-refinery-test
Created January 26, 2011 22:32
refinerycms create project on clean railsinstaller environment
C:\!Prog>refinerycms wintest
Running: cmd /c rails new "C:\!Prog\wintest" --database sqlite3 --skip-test-unit --skip-prototype
create
create README
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/controllers/application_controller.rb
@simi
simi / wintest
Created January 26, 2011 22:55
Refinery 0.9.9 - new project created on clean RailsInstaller 1.0.2 Windows 7/64 system
C:\!Prog>refinerycms wintest
Running: cmd /c rails new "C:\!Prog\wintest" --database sqlite3 --skip-test-unit --skip-prototype
create
create README
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/controllers/application_controller.rb
@simi
simi / ugly.rb
Created March 2, 2011 15:24
Don't like this
attr_reader :loaded
def loaded?
loaded = @loaded ? true : false
@loaded = true
return loaded
end
@simi
simi / omg.js
Created March 3, 2011 16:41
Crazy code
for(var pumpkin = 0; pumpkin < 10; pumpkin++){
if(marshmallow == swimmingpools[pumpkin]) marshmallow = pumpkin;
if(big_dragon == swimmingpools[pumpkin]) big_dragon = pumpkin;
}
var princess = marshmallow + big_dragon;
princess = swimmingpools[princess];
$('#turbosnail').attr('value', princess);
@simi
simi / error
Created March 25, 2011 14:29
error
ruby-1.8.7-p302 > Contact.with_locales(:en)
ActiveRecord::StatementInvalid: Mysql::Error: Unknown column 'contact_translations.locale' in 'where clause': SELECT `contacts`.* FROM `contacts` WHERE `contact_translations`.`locale` IN ('en')
from /home/retro/.rvm/gems/ruby-1.8.7-p302@mycoolproject/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:207:in `log'
from /home/retro/.rvm/gems/ruby-1.8.7-p302@mycoolproject/gems/activerecord-3.0.5/lib/active_record/connection_adapters/mysql_adapter.rb:289:in `execute'
from /home/retro/.rvm/gems/ruby-1.8.7-p302@mycoolproject/gems/activerecord-3.0.5/lib/active_record/connection_adapters/mysql_adapter.rb:619:in `select'
from /home/retro/.rvm/gems/ruby-1.8.7-p302@mycoolproject/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all'
from /home/retro/.rvm/gems/ruby-1.8.7-p302@mycoolproject/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/query_cache.rb:56:in `sel
class Employee < ActiveRecord::Base
acts_as_indexed :fields => [:name, :content]
validates :name, :presence => true, :uniqueness => true
belongs_to :photo, :class_name => 'Image'
end
ruby-1.8.7-p302 > class Banan < ActiveRecord::Base
ruby-1.8.7-p302 ?> set_table_name "clientzone_users"
ruby-1.8.7-p302 ?> attr_accessible :email
ruby-1.8.7-p302 ?> end
=> #<ActiveModel::MassAssignmentSecurity::WhiteList: {"email"}>
ruby-1.8.7-p302 >
ruby-1.8.7-p302 > class Banan2 < ActiveRecord::Base
ruby-1.8.7-p302 ?> set_table_name "clientzone_users"
ruby-1.8.7-p302 ?> end
=> #<Proc:0x00007f7e12cb3558@/home/retro/.rvm/gems/[email protected]/gems/activemodel-3.0.7.rc1/lib/active_model/attribute_methods.rb:110>