Skip to content

Instantly share code, notes, and snippets.

@flooose
flooose / 0.0.3
Created November 19, 2010 14:51
In the last two weeks things here have continued to roll ahead.
The 0.0.3 Tag has been pushed github and here's a short summary of what's changed in the last couple of weeks.
First we've extracted "activesupport-slices":https://github.com/svenfuchs/activesupport-slices into a gem. We've also extracted has_one_default from the Page.article associations and ActiveRecord::Base.categorizable.
In terms of what's been refactoring, we've changed the blog_post route so that we no longer need a fake route. polymorphic url_for has also been reworked a bit. It's not yet complete, but it does already support multiple compinations of sti models. For example, url_for([blog, post]) will check blog_post_path, blog_content_path, section_post_path and section_content_path and use the first one that the view responds to.
Other things that got some attention in the past couple of weeks are the Section#path method and the blog pages. Posts that are assigned to a category's sub-categories are now included in their
[chris@turnstile sk_b2c]$ pg_config
BINDIR = /usr/bin
DOCDIR = /usr/share/doc/postgresql
HTMLDIR = /usr/share/doc/postgresql
INCLUDEDIR = /usr/include
PKGINCLUDEDIR = /usr/include/postgresql
INCLUDEDIR-SERVER = /usr/include/postgresql/server
LIBDIR = /usr/lib
PKGLIBDIR = /usr/lib/postgresql
LOCALEDIR = /usr/share/locale
Uncategorized
* bump to 0.0.4
* bump simple_nested_set
* Merge branch 'rails-3.0.3' into develop
* bump simple_nested_set
Highlights:
* make BaseController#category a helper method
* add category to base controller
Minor changes:
@flooose
flooose / super called outside of method
Created January 7, 2011 13:50
super called outside of method
Scenario: Successful login # adva-user/features/session.feature:15
Given a confirmed user with email "bob@domain.com" and password "bobpass" # adva-user/lib/testing/step_definitions.rb:15
super called outside of method (NoMethodError)
./adva-core/lib/core_ext/rails/active_record/skip_callbacks.rb:38:in `call'
./adva-core/lib/core_ext/rails/active_record/skip_callbacks.rb:38:in `_run_save_callbacks'
./adva-core/lib/core_ext/rails/active_record/skip_callbacks.rb:16:in `send'
./adva-core/lib/core_ext/rails/active_record/skip_callbacks.rb:16:in `method_missing'
./adva-core/lib/core_ext/rails/active_record/skip_callbacks.rb:28:in `skip_callbacks'
./adva-core/lib/core_ext/rails/active_record/skip_callbacks.rb:15:in `method_missing'
./adva-user/lib/testing/step_definitions.rb:16:in `/a confirmed user with email "([^"]+)" and password "([^"]+)"/'
#!/usr/bin/env bash
# update the local repositories if needed
if [ $REPOSITORIES ]; then
echo "Updating local repositories"
for REPOSITORY in `ls ${REPOSITORIES}`; do
echo "${REPOSITORY}: "
( cd ${REPOSITORIES}/$REPOSITORY; git clean -fdx; git pull; git reset --hard HEAD )
done
echo "Done updating `ls ${REPOSITORIES} | wc -l` local repositories"
else
@flooose
flooose / gist:824659
Created February 13, 2011 12:52
0.0.8
try speeding up tests a little using a plain encryptor for devise (i.e. don't encrypt passwords in tests), see http://oinopa.com/2011/02/05/want-a-faster-test-suite.html
refactor adva:static:setup task to use overloadable methods, so we can configure git user.name and user.email in unit tests for running builds on systems that don't have git configured properly
fix test_helper inclusion in adva:static unit tests
fix tables_differ_message
$ cat app/assets/javascripts/posts.js.coffee
...
$('h1').click ->
$(@).addClass 'clicked'
...
$
@flooose
flooose / gist:1809695
Created February 12, 2012 17:13
rails new blog
$ rails new blog
$ cd rails
$ rails g scaffold Post title:string content:text
@flooose
flooose / RedisSupport.rb
Created April 19, 2012 08:37
Module with dynamic method.
module RedisSupport
after_save :load_into_redis
before_destroy :remove_from_redis
def self.included(base)
unless base.respond_to? :load_into_redis
raise(Exception.new, "Please define the methods \"load_into_redis\" before including this module")
end
end
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/(^|=[ \t])*class ([A-Za-z]+\.)*([A-Za-z]+)( extends [A-Za-z_.]+)?$/\3/c,class/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?@?([A-Za-z_.]+):.*[-=]>.*$/\3/m,method/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?([A-Za-z_.]+)[ \t]+=.*[-=]>.*$/\3/f,function/
--regex-coffee=/^[ \t]*([A-Za-z_.]+)[ \t]+=[^->\n]*$/\1/v,variable/
--regex-coffee=/^[ \t]*@([A-Za-z_.]+)[ \t]+=[^->\n]*$/\1/f,field/
--regex-coffee=/^[ \t]*@([A-Za-z_.]+):[^->\n]*$/\1/f,static field/
--regex-coffee=/^[ \t]*([A-Za-z_.]+):[^->\n]*$/\1/f,field/