GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Collective Idea's Awesomeness. A collection of useful Rails bits and pieces.
Clone URL: git://github.com/collectiveidea/awesomeness.git
Click here to lend your support to: awesomeness and make a donation at www.pledgie.com !
brandon (author)
Sun Apr 27 14:16:47 -0700 2008
commit  8e538b37c014ae23187e5da67c1e9f966dbcc671
tree    547a95a3b3df116b75895df9c6da430c2ab3641b
parent  025ec9b8ce5eaead17f5db2e1ded1ec81803e1d9
awesomeness / README
100644 52 lines (29 sloc) 1.198 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Collective Idea's Awesomeness
=============================
 
A collection of stuff that we use often, but not generic enough to go in another plugin.
 
If you've stumbled across this and love/hate it, let us know!
 
== Core Extensions
 
* Object#tap (http://moonbase.rydia.net/mental/blog/programming/eavesdropping-on-expressions)
 
* String#widont to make typography nicer (http://shauninman.com/archive/2006/08/22/widont_wordpress_plugin)
 
* Array#uniq with a block
 
  >> %w(the cow jumped over the moon).uniq {|s| s.length }
  => ["the", "jumped", "over"]
 
* Round floats to the nearest x
 
  >> 5.38475.round(0.5)
  => 5.5
 
* Hash goodies
 
  >> {:a => [1,3,4], :b => [2,5]}.without(:a => 1)
  => {:a => [3,4], :b => [2,5]}
 
  >> {:a => "", :b => nil, :c => 1}.compact
  => {:c => 1}
 
* And more…
 
== Rails Helpers
 
* Unicode TextHelper additions that change the default truncate & excerpt string to an elipsis (…) instead of just three periods (...)
 
* Add widont to textilize methods
 
* Transparent removal of trailing slashes in URLs
 
== Rake Tasks
 
== Capistrano Recipes
 
* Use :remote_cache by default
 
* Disable and enable web during restarts
 
* Run deploy:cleanup after deploys
 
* Backups