Skip to content

Instantly share code, notes, and snippets.

View juarezpaf's full-sized avatar

Juarez Filho juarezpaf

View GitHub Profile
@db
db / jquery.ajax.progress.js
Created May 11, 2011 12:43
add XHR2 progress events to jQuery.ajax
(function addXhrProgressEvent($) {
var originalXhr = $.ajaxSettings.xhr;
$.ajaxSetup({
progress: function() { console.log("standard progress callback"); },
xhr: function() {
var req = originalXhr(), that = this;
if (req) {
if (typeof req.addEventListener == "function") {
req.addEventListener("progress", function(evt) {
that.progress(evt);
@timblair
timblair / caveatPatchor.js
Created February 15, 2011 10:27 — forked from protocool/caveatPatchor.js
Sample caveatPatchor.js file for use in Propane 1.1.2 and above: pulls avatars from Gravatar
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
require 'nokogiri'
require 'open-uri'
meu_lance = 100.00
def get_current_price()
doc = Nokogiri::HTML(open("http://viniciusteles.com.br/moveis/puff-lilas"))
doc.xpath('//div[@id="bidding"]/h3/em').to_s =~ /.*R\$ (.*).*/
$1.to_f
end