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
    
  
  
    
  | if tty <&1 >/dev/null; then | |
| echo " Loading settings from $0" | |
| fi | 
  
    
      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
    
  
  
    
  | #!/usr/bin/env ruby -w | |
| # svndiff: svn diff with textmate | |
| # usage: svndiff <file> | |
| unless ARGV.first.nil? | |
| system("svn diff #{ARGV.first}|mate") | |
| end | 
  
    
      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
    
  
  
    
  | #creating patch: | |
| cp file file.old | |
| diff -uN file.old file > file.diff | |
| #or git diff/svn diff | |
| #applying patch: | |
| patch -N -p0 < file | |
  
    
      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
    
  
  
    
  | class String | |
| # 00 Turn off all attributes | |
| # 01 Set bright mode | |
| # 04 Set underline mode | |
| # 05 Set blink mode | |
| # 07 Exchange foreground and background colors | |
| # 08 Hide text (foreground color would be the same as background) | |
| # 30 Black text | |
| # 31 Red text | 
  
    
      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
    
  
  
    
  | # puts nil where it can't transpose... | |
| class Array | |
| def safe_transpose | |
| result = [] | |
| max_size = self.max { |a,b| a.size <=> b.size }.size | |
| max_size.times do |i| | |
| result[i] = Array.new(self.first.size) | |
| self.each_with_index { |r,j| result[i][j] = r[i] } | |
| end | |
| result | 
  
    
      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
    
  
  
    
  | rake db:sessions:create | |
| rake db:migrate | |
| #environment.rb: | |
| config.action_controller.session_store = :active_record_store | 
  
    
      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
    
  
  
    
  | before_create :set_id | |
| private | |
| def set_id | |
| self[:id] = id | |
| end | |
| ## addition by sdecaste: (above method didn't seem to work with ActiveRecord::BaseWithoutTable) | 
  
    
      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
    
  
  
    
  | make setup 2>&1 | tee make_setup.out~ | |
| make config 2>&1 | tee make_config.out~ | |
| make compile 2>&1 | tee make_compile.out~ | |
| sudo make install 2>&1 | tee make_install.out~ | |
| sudo make pkginstall 2>&1 | tee make_pkginstall.out~ | 
  
    
      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
    
  
  
    
  | #For a intro text with read more link | |
| truncate(model.text, :length => 50, link_to('(read more)', read_more_path)) | 
NewerOlder