My Recent Pastes (95 and counting)
Pastes by brough (95 and counting)
Below are the 15 most recent pasties by brough.
November 07, 2007
1:58AM EDT
by brough
View all 50 lines
[mootools] function process_preview(){ $$('#process select').each(function(pro){
November 06, 2007
10:35PM EDT
by brough
View all 84 lines
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
View all 23 lines
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
View all 16 lines
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
View all 6 lines
>> s = "1,2,3"
=> "1,2,3"
>> a = s.split(",")
=> ["1", "2", "3"]
>> a.class
October 17, 2007
7:02PM EDT
by brough
View all 6 lines
-cache ({:page => params[:page] || 1}) do
-@products.each do |product|
%li= product.model
.pagination_bottom
October 16, 2007
7:17PM EDT
by brough
View all 7 lines
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
View all 13 lines
document.observe('contentloaded', function(){ add_history(); alert('ok'); });
October 10, 2007
6:24AM EDT
by brough
View all 28 lines
before_filter :connect_s3 def connect_s3 AWS::S3::Base.establish_connection!( :access_key_id => 'xxxxxxxxxx',
October 10, 2007
5:11AM EDT
by brough
View all 49 lines
def create @cloud = Cloud.new(params[:cloud]) if @cloud.save
October 09, 2007
3:04PM EDT
by brough
View all 60 lines
window.addEvent('domready',function(){ print_footnotes(); });
October 09, 2007
9:27AM EDT
by brough
View all 172 lines
/* 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
View all 50 lines
window.addEvent('domready', function(){ init(); }); var scrollysniff = 1
September 26, 2007
8:17AM EDT
by brough
View all 74 lines
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
View all 12 lines
# 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
