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
    
  
  
    
  | drag: function(event, ui) { | |
| var inst = $(this).data("draggable"), o = inst.options; | |
| var d = o.snapTolerance; | |
| var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, | |
| y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; | |
| for (var i = inst.snapElements.length - 1; i >= 0; i--){ | 
  
    
      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
    
  
  
    
  | auto_minimize: () -> | |
| @_auto_minimize ||= _.debounce (=> this.minimize()), 4000 | |
| @_auto_minimize() | 
  
    
      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
    
  
  
    
  | (defun ruby-reindent-then-newline-and-indent () | |
| (interactive "*") | |
| (let* ((cur (point)) | |
| ;; we need to insert a space artificially for this test to work properly :( | |
| (expand-p (progn (insert " ") | |
| (ruby-electric-space-can-be-expanded-p)))) | |
| ;; remove the inserted space | |
| (progn (goto-char cur) | |
| (delete-char 1)) | 
  
    
      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
    
  
  
    
  | def print | |
| @doc = Document.find(params[:id]) | |
| respond_to do |format| | |
| format.html { | |
| render "final", :layout => "print" | |
| } | |
| format.pdf { | |
| html = render_to_string "final", :layout => "print" | |
| p [:output,html] | |
| kit = PDFKit.new(html, :page_size => 'Letter') | 
  
    
      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
    
  
  
    
  | $ () -> | |
| window.search = new LiveSearch("#search") | |
| class LiveSearch | |
| constructor: (context,result) -> | |
| el = @context = $(context) | |
| @result = el.find(".result") | |
| @form = el.find("form") | |
| @form.bind "ajax:success", (e,data) => | |
| window.data = data | 
  
    
      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
    
  
  
    
  | module DealsHelper | |
| def slider(klass,attr,opts={}) | |
| options = { | |
| :max => max=klass.maximum(attr), | |
| :min => min=klass.minimum(attr), | |
| :range => true, | |
| :values => [min,max] | |
| }.merge(opts).to_json | |
| input = hidden_field_tag "#{klass.to_s.underscore}[#{attr}]" | |
| raw <<-HTML | 
  
    
      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
    
  
  
    
  | <form action="#{search_path}" data-remote="true" data-type="html"> | |
| <div class='section'> | |
| <h2>Dollar Amount Required</h2> | |
| <%= slider(Deal,:dollar_amount_required,:format => "million",:step => 500_000) %> | |
| </div> | |
| <div class='section'> | |
| <h2>Expected IRR</h2> | |
| <%= slider(Deal,:expected_irr,:format => "percent",:step => 50) %> | |
| </div> | 
  
    
      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
    
  
  
    
  | module Abbrev | |
| # Given a set of strings, calculate the set of unambiguous | |
| # abbreviations for those strings, and return a hash where the keys | |
| # are all the possible abbreviations and the values are the full | |
| # strings. Thus, given input of "car" and "cone", the keys pointing | |
| # to "car" would be "ca" and "car", while those pointing to "cone" | |
| # would be "co", "con", and "cone". | |
| # | 
  
    
      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
    
  
  
    
  | flet do | |
| def fact(i) | |
| return 1 if i == 1 | |
| i * fact(i-1) | |
| end | |
| def fib(i) | |
| return 1 if i == 0 | |
| return 1 if i == 1 | |
| fib(i-1) + fib(i-2) | 
  
    
      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
    
  
  
    
  | require 'rubygems' | |
| require 'rdiscount' | |
| require 'nokogiri' | |
| $blog = [:blog, | |
| [[:timestamps, "2009-03-17T16:04:34-07:00"], | |
| [:title, "Does Ruby Dream An Eclectic Shell?"], | |
| [:categories, "hack"]], | |
| [[:md, | |
| [], |