Skip to content

Instantly share code, notes, and snippets.

View anlek's full-sized avatar
💬
Writing code...

Andrew Kalek anlek

💬
Writing code...
View GitHub Profile
Nested = Behavior.create({
initialize: function(options) {
this.options = Object.extend({
evaluateScripts : true
}, options || {});
this.container = this.options.container || 'li'
},
_replace_ids : function (s){
var new_id = new Date().getTime();
return s.replace(/NEW_RECORD/g, new_id);
require 'rubygems'
require 'eventmachine'
require 'em-http' # gem install em-http-request
require 'yajl' # gem install yajl-ruby
class String
def bold
"\033[1m#{self}\033[0m"
end
end
var Driver = {
add: function(event) {
event.stop();
$(this.get('rel'))
.insert(Driver.template(this))
.subNodes().last().show('fade');
},
remove: function(event) {
source 'http://rubygems.org'
gem 'rails', '3.0.0.beta4'
#Database stuff
gem 'mongoid', :git => 'git://github.com/durran/mongoid.git'
gem 'bson_ext'
gem 'carrierwave', :git => "git://github.com/jnicklas/carrierwave.git"
gem 'mini_magick', :git => 'git://github.com/probablycorey/mini_magick.git'
~/rails_apps/example.com% rails g scaffold -h
DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from <class:Railtie> at /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/will_paginate-3.0.pre/lib/will_paginate/railtie.rb:6)
/Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/railties-3.0.0.beta4/lib/rails.rb:44:in `configuration': undefined method `config' for nil:NilClass (NoMethodError)
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/newrelic_rpm-2.12.3/lib/newrelic_rpm.rb:25:in `<top (required)>'
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/bundler-1.0.0.beta.1/lib/bundler/runtime.rb:48:in `require'
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/bundler-1.0.0.beta.1/lib/bundler/runtime.rb:48:in `block (2 levels) in require'
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/bundler-1.0.0.beta.1/lib/bundler/runtime.rb:47:in `each'
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/bundler-1.0.0.beta.1/lib/bundler/runtime.rb:4
~/rails_apps/example.com% rails c
DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from <class:Railtie> at /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/will_paginate-3.0.pre/lib/will_paginate/railtie.rb:6)
/Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/bson-1.0.3/lib/bson/bson_c.rb:24:in `serialize': keys must be strings or symbols (TypeError)
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/bson-1.0.3/lib/bson/bson_c.rb:24:in `serialize'
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/mongo-1.0.3/lib/mongo/cursor.rb:364:in `construct_query_message'
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/mongo-1.0.3/lib/mongo/cursor.rb:346:in `send_initial_query'
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/mongo-1.0.3/lib/mongo/cursor.rb:324:in `refill_via_get_more'
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/mongo-1.0.3/lib/mongo/cursor.rb:319:in `num_remaining'
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example
Using RSpec
Loading Spork.prefork block...
- Spork Diagnosis -
-- Summary --
config/application.rb
config/boot.rb
config/environment.rb
config/initializers/app_settings.rb
config/initializers/backtrace_silencers.rb
config/initializers/compass.rb
@anlek
anlek / Gemfile
Created July 21, 2010 19:01
Issues with bundler
source 'http://rubygems.org'
gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'credit_card_validator'
#Database stuff
gem "bson_ext"
gem 'mongoid', :git => 'git://github.com/durran/mongoid.git', :require => 'mongoid'
@anlek
anlek / console_output.rb
Created July 23, 2010 19:30
Error that is killing my ruby process using Mogoid and embedded documents
Loading development environment (Rails 3.0.0.beta4)
>> p = Product.first
=> #<Product _id: 4c49f114b57f98927c000001, name: "test", created_at: Fri Jul 23 19:44:22 UTC 2010, updated_at: Fri Jul 23 19:44:22 UTC 2010>
>> pu = Purchaser.new(:name => 'bob')
=> #<Purchaser _id: 4c49f26fb57f989391000001, name: "bob">
>> p.purchasers << pu
=> [#<Purchaser _id: 4c49f26fb57f989391000001, name: "bob">]
>> p.save
src/tcmalloc.cc:353] Attempt to free invalid pointer: 0x225330
@anlek
anlek / console
Created July 23, 2010 23:13
Issue found when running bundle install
ubuntu /var/www/staging.example.com/current: sudo gem install bundler --pre
Successfully installed bundler-1.0.0.beta.9
1 gem installed
Installing ri documentation for bundler-1.0.0.beta.9...
Installing RDoc documentation for bundler-1.0.0.beta.9...
#^#^# JUST to show I have the latest bundler installed #^#^#
ubuntu /var/www/staging.example.com/current: bundle install
Fetching source index for http://rubygems.org/
fatal: Not a valid object name 5ebc1d8
An error has occurred in git. Cannot complete bundling.