This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TODO: | |
- edit /opt/statsd/local.js | |
- correct the graphite host to localhost | |
- if desired, put 'debug: true' in there | |
- make the box accessible via the hostname 'graphite' | |
- patch graphite, like described in https://answers.launchpad.net/graphite/+question/152851 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This example shows how to setup an environment running Rails 3 under 1.9.2 with a 'rails3' gem set. | |
∴ rvm update --head | |
# ((Open a new shell)) or do 'rvm reload' | |
# If you do not already have the ruby interpreter installed, install it: | |
∴ rvm install 1.9.2 | |
# Switch to 1.9.2-head and gemset rails31rc, create if it doesn't exist. | |
∴ rvm --create use 1.9.2@rails31rc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://nokogiri.org/tutorials/installing_nokogiri.html#mac_os_x | |
# using rvm with ruby-1.8.7-tv1_8_7_174 | |
# latest version 2.7.7 2010-06-17 | |
brew install libxml2 | |
brew link libxml2 (FAILS) - so have to include below | |
# installing libxslt from source code | |
wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
running OSX 10.5.8 | |
same error in ruby 1.9.2 | |
mj:~ mark$ gem install ffi | |
Building native extensions. This could take a while... | |
ERROR: Error installing ffi: | |
ERROR: Failed to build gem native extension. | |
/Users/mark/.rvm/rubies/ruby-1.8.7-p302/bin/ruby extconf.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Key issue - format of entered dates: | |
date is displayed like: 31/3/2011 | |
date is input like: 31-3-2011 | |
This is works correctly in ruby 1.8 and 1.9 | |
ruby-1.8.7-p302 > Time.parse '31-3-2011' # => Thu Mar 31 00:00:00 -1000 2011 | |
ruby-1.9.2-p0 > Time.parse('31-3-2011') # => 2011-03-31 00:00:00 -1000 | |
Changes in parsing dates for ruby 1.9: | |
* no longer has difference in parsing dates with dash or forward slash - they are always in euro format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Time.parse('3-31-2011') | |
Time.parse('31-3-2011') | |
Time.parse('3/31/2011') | |
Time.parse('31/3/2011') | |
ruby-1.8.7-p302 > Time.parse('3-31-2011') | |
ArgumentError: argument out of range | |
from /Users/mark/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/time.rb:184:in `local' | |
from /Users/mark/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/time.rb:184:in `make_time' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The rails check_box form helper inserts a hidden checkbox to handle unchecked check boxes. This doesn't work when the check box is within an array-like parameter - i.e. project[invoice_attributes][blah]. | |
So - below will append a hidden form field with a value - so it can be handled in your controller or model etc. | |
for: | |
<%= check_box_tag("instance[data][blah]") %> | |
jquery: | |
$("#instance_form").submit(function() { | |
// insert hidden checkbox with value 0 - so unchecked checkboxes submit a value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mj:fluxx_shakti mark$ DEV_LOCAL=1 rake ts:rebuild RAILS_ENV=fastdev --trace | |
(in /Users/mark/work/fluxx/s1/fluxx_shakti) | |
"Installing dependent fluxx gems to point to local paths. Be sure you install fluxx_engine, fluxx_crm and fluxx_grant in the same directory as the reference implementation." | |
"ESH: loading fluxx_engine" | |
"ESH: loading fluxx_crm" | |
"ESH: loading fluxx_grant" | |
** Invoke ts:rebuild (first_time) | |
** Invoke thinking_sphinx:rebuild (first_time) | |
** Invoke thinking_sphinx:app_env (first_time) | |
** Execute thinking_sphinx:app_env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mj:~/work/mm/github/mm mark$ git push origin master | |
Counting objects: 9, done. | |
Compressing objects: 100% (7/7), done. | |
Writing objects: 100% (7/7), 946 bytes, done. | |
Total 7 (delta 2), reused 0 (delta 0) | |
To [email protected]:johnsome/mm.git | |
07ee404..d2a36a6 master -> master | |
mj:~/work/mm/github/mm mark$ git push heroku | |
Counting objects: 12, done. | |
Compressing objects: 100% (10/10), done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rails testapp -m http://gist.github.com/314722.txt | |
file 'Gemfile', <<-CODE | |
source 'http://gemcutter.org' | |
gem "rails", :git => "git://github.com/rails/rails.git" | |
gem "sqlite3-ruby", :require => "sqlite3" | |
group :test do | |
gem "rspec-rails", ">= 2.0.0.a9" | |
end |
NewerOlder