Skip to content

Instantly share code, notes, and snippets.

# Fabrication
Fabricator(:user) do
email { sequence(:email) { |n| "tester#{n}@test.com" } }
password 'tester'
end
Fabricator(:store, from: :dropbox_store) do
path '/myproject'
end
@jgonera
jgonera / gist:781722
Created January 16, 2011 12:01
JS for file upload progress with gp.fileupload and Nginx module
function pollGp() {
$.ajax({
type: 'GET',
url: '/gp.fileupload.stat/${c.upload_id}',
cache: false,
dataType: 'json',
timeout: 5000,
success: function(response) {
if (response.state == 1) {
$('#progressbar div').css('width', response.percent + '%');