My Recent Pastes (95 and counting)

Pastes by brough (95 and counting)

Pages:

Below are the 15 most recent pasties by brough.

November 07, 2007
1:58AM EDT
by brough

[mootools]

function process_preview(){

$$('#process select').each(function(pro){          

November 06, 2007
10:35PM EDT
by brough

require 'date'
csv = File.readlines('/media/apps/hestia/lib/csv_flatfiles/ra.csv')

csv.collect!{|c| c.gsub!(/1,0((?:,0)*?)(,0)?(?=,1)/,'1,x\1,y')}

November 05, 2007
3:24PM EDT
by brough

take a paragraph of text. Highlight clauses/sentences containing *keywords* - mostly
items in a list the user wants to attract particular attention to, such as "cats, 
dogs, <em>*gnats*</em>, rabbits". If there is no comma, highlight the entire sentence.
<em>Rabbits **** for *free*!</em>

November 05, 2007
3:22PM EDT
by brough

  def keywords(content)
    keywords = %w{free complimentary disabled woodburning fire disappointment heart tray fuel lovely fantasitc charming dating spacious babysitting basket cosy}
    clauses = content.split(',').collect{|c| x = c+','; c = x.gsub(/\. ,/,'.').gsub(/\.,/,'.')}
      clauses.collect!{|c|
        keywords.each{|keyword|

October 22, 2007
4:43AM EDT
by brough

>> s = "1,2,3"
=> "1,2,3"
>> a = s.split(",")
=> ["1", "2", "3"]
>> a.class

October 17, 2007
7:02PM EDT
by brough

-cache ({:page => params[:page] || 1}) do
  -@products.each do |product|
    %li= product.model

  .pagination_bottom

October 16, 2007
7:17PM EDT
by brough

names = page.search('div.name')
addresses = page.search('div.address')

names.each_with_index do |name,index|
  address = address[index - 1]

October 10, 2007
4:08PM EDT
by brough

document.observe('contentloaded', function(){
 add_history(); 
 alert('ok');
}); 

October 10, 2007
6:24AM EDT
by brough

  before_filter :connect_s3

  def connect_s3
    AWS::S3::Base.establish_connection!(
      :access_key_id => 'xxxxxxxxxx', 

October 10, 2007
5:11AM EDT
by brough

  def create
    @cloud = Cloud.new(params[:cloud])

     if @cloud.save

October 09, 2007
3:04PM EDT
by brough

window.addEvent('domready',function(){
 print_footnotes();
});


October 09, 2007
9:27AM EDT
by brough

/* create footnotes for all unique off-site links in a document, 
referring repeated links to the existing footnote.

Footnote container appended to document body after the last element.  

October 04, 2007
7:39PM EDT
by brough

window.addEvent('domready', function(){
 init();
});

var scrollysniff = 1

September 26, 2007
8:17AM EDT
by brough

first xml, using REXML:

Completed in 1.14889 (0 reqs/sec) | Rendering: 0.47365 (41%) | DB: 0.01001 (0%) | 200 OK 

September 21, 2007
3:19AM EDT
by brough

# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time

Next page

Previous page