Sharp End LLC http://sharpendllc.posterous.com Most recent posts at Sharp End LLC posterous.com Tue, 20 Dec 2011 13:27:00 -0800 jquery fade notices quick and easy http://sharpendllc.posterous.com/jquery-fade-notices-quick-and-easy http://sharpendllc.posterous.com/jquery-fade-notices-quick-and-easy

$('.notice').fadeIn().delay(2000).fadeOut('slow');

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1327055/SE_logo_square.jpg http://posterous.com/users/hcH2JLNr5W74m sharpendllc sharpendllc sharpendllc
Wed, 07 Sep 2011 19:00:00 -0700 sqlite3-ruby with Rails 2.3.5 on CentOS 5.5 http://sharpendllc.posterous.com/sqlite3-ruby-with-rails-235-on-centos-55 http://sharpendllc.posterous.com/sqlite3-ruby-with-rails-235-on-centos-55

We were getting all kinds of weird errors, some from passenger, some apps wouldnt start even with mongrel, and when they did, they would die as soon as you hit them with a browser. 

simple fix

 

gem uninstall sqlite3 sqlite3-ruby; gem install sqlite3-ruby v=1.2.5;

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1327055/SE_logo_square.jpg http://posterous.com/users/hcH2JLNr5W74m sharpendllc sharpendllc sharpendllc
Fri, 08 Jul 2011 09:38:00 -0700 git add commit and deploy script http://sharpendllc.posterous.com/gist-test http://sharpendllc.posterous.com/gist-test
1
2
3
4
5
6
7
8
9
10
11
12
# Just a little sh we put in our root or user root folder to fully add, commit, push, and deploy a site
# Filename: deploy.sh
# Usage: from app root
# Run in terminal: sh ~/deploy.sh "Your Message of the Commit"


#! /bin/sh
message=$1;
git add . ;
git commit -m"$message";
git push;
cap deploy;

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1327055/SE_logo_square.jpg http://posterous.com/users/hcH2JLNr5W74m sharpendllc sharpendllc sharpendllc
Fri, 08 Jul 2011 08:51:00 -0700 snippet: link post to remote action http://sharpendllc.posterous.com/snippet-link-post-to-remote-action http://sharpendllc.posterous.com/snippet-link-post-to-remote-action

1
= link_to "Remote Function", copy_question_users_path(:q_id => question.id), :class => "button_class", :remote => true, :id => "copy_btn_#{question.id}", :method => :post

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1327055/SE_logo_square.jpg http://posterous.com/users/hcH2JLNr5W74m sharpendllc sharpendllc sharpendllc
Tue, 05 Jul 2011 11:37:00 -0700 snippet: render results of search http://sharpendllc.posterous.com/snippet-render-results-of-search http://sharpendllc.posterous.com/snippet-render-results-of-search

1
2
3
4
5
6
7
8
9
10
#search-div
  -remote_form_for "search", :url => '/admin/scrubber_tool_search' do |f|
    = f.text_field :keyword = f.submit "Search", :class => 'button'
%hr
#results
  NONE

then in scrubber_tool_search.js.erb

jQuery("#results").html("<%= escape_javascript(render :partial => 'scrubber_tool_search_results') %>");

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1327055/SE_logo_square.jpg http://posterous.com/users/hcH2JLNr5W74m sharpendllc sharpendllc sharpendllc
Mon, 04 Jul 2011 16:30:00 -0700 snippet: Folder Size http://sharpendllc.posterous.com/folder-size http://sharpendllc.posterous.com/folder-size

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  def sizer(dirname)
    total_size = 0
    Find.find(dirname) do |path|
      if FileTest.directory?(path)
        if File.basename(path)[0] == ?.
          Find.prune # Don't look any further into this directory.
        else
          next
        end
      else
        total_size += FileTest.size(path)
      end
    end
    total_size / 1048576
  end

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1327055/SE_logo_square.jpg http://posterous.com/users/hcH2JLNr5W74m sharpendllc sharpendllc sharpendllc