Skip to content

Instantly share code, notes, and snippets.

<% content_for :body_content_page_title, "#{@news_item.title}" -%>
<% content_for :body_content_left do %>
<%= @news_item.body %>
<span class="right date"><small>Published <%= @news_item.publish_date.strftime("%A %d of %B, %Y") %></small></span>
<p>
<%= link_to "Back to all news", news_items_url %>
</p>
<% end %>
<% content_for :body_content_right do %>
Charles:refinery_test charles$ rake db:setup
(in /Users/charles/Documents/Rails/refinery_test)
/opt/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement
[BUG] cross-thread violation on rb_gc()
(null)
Abort trap
Charles:refinery_test charles$ rm -rf ./vendor/plugins/slim_scrooge
Charles:refinery_test charles$ rake db:setup
(in /Users/charles/Documents/Rails/refinery_test)
charles@Charles ~/Documents/Rails $ git clone git://github.com/resolve/refinerycms.git refinery_test
Initialized empty Git repository in /Users/charles/Documents/Rails/refinery_test/.git/
remote: Counting objects: 13618, done.
remote: Compressing objects: 100% (6686/6686), done.
remote: Total 13618 (delta 5655), reused 12987 (delta 5282)
Receiving objects: 100% (13618/13618), 9.76 MiB | 864 KiB/s, done.
Resolving deltas: 100% (5655/5655), done.
charles@Charles ~/Documents/Rails $ cd refinery_test
charles@Charles ~/Documents/Rails/refinery_test $ mate .
charles@Charles ~/Documents/Rails/refinery_test $ rake db:setup
Here is the complete workflow
$ git clone [email protected]:unixcharles/refinerycms.git && cd refinerycms
Create a new branch
$ git checkout -b bugfixes
... some change, few days and a few commits later... I can also push the work-in-process-branch change to github if I plan to work on a different computer or share idea
When I'm done I do:

User can generate url/key for project when they have the right to comment:

teambox.com/hooks/:key

Each key tie to project and user

@hook = Hook.find_by_key(params[:key])

Optional params

$ git push heroku master
Counting objects: 1852, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (486/486), done.
Writing objects: 100% (1614/1614), 446.30 KiB, done.
Total 1614 (delta 1175), reused 1531 (delta 1113)
-----> Heroku receiving push
-----> Rails app detected
-----> Detected use of caches_page
@unixcharles
unixcharles / fix_permission.rb
Created October 19, 2010 13:03
Fix permission issue on Amazon S3. Restore to default paperclip setting
BUCKET = "teambox-assets"
# require 'aws/s3'
AWS::S3::Base.establish_connection!(:access_key_id => YOUR_ACCESS_KEY, :secret_access_key => YOUR_SECRET_KEY )
include AWS::S3
def set_public(key, bucket)
policy = S3Object.acl(key, bucket)
policy.grants << ACL::Grant.grant(:public_read)
@unixcharles
unixcharles / nginx.conf
Last active November 4, 2024 17:09
nginx config for http/https proxy to localhost:3000
#user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
@unixcharles
unixcharles / log_sql.rb
Created May 18, 2011 09:57
Query report
# initializer, run dev or test with LOG_SQL=true to log SQL
connection = ActiveRecord::Base.connection
class << connection
alias :original_exec :execute
def execute(sql, *name)
# try to log sql command but ignore any errors that occur in this block
# we log before executing, in case the execution raises an error
begin
file = File.open(RAILS_ROOT + "/log/queries.sql",'a'){|f| f.puts sql}
rescue Exception => e
@unixcharles
unixcharles / Ohhh noes.txt
Created September 19, 2011 14:20
OSX libxml2 error fix
Look like brew libxml2 and the one bundled with osx are fighting
/Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/libxml-ruby-1.1.4/lib/libxml_ruby.bundle: dlsym(0x7ffb44ee7880, Init_libxml_ruby): symbol not found - /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/libxml-ruby-1.1.4/lib/libxml_ruby.bundle (LoadError)
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/libxml-ruby-1.1.4/lib/libxml.rb:9
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each'
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `require'
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each'
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.1