Skip to content

Instantly share code, notes, and snippets.

View oswaldoacauan's full-sized avatar
🔮
Snapshot tests are bad. Change my mind.

Oswaldo Acauan oswaldoacauan

🔮
Snapshot tests are bad. Change my mind.
View GitHub Profile
@oswaldoacauan
oswaldoacauan / jquery.ajax.progress.js
Created August 27, 2013 12:17
Javascript - jQuery Ajax Progress
// Live demo
// http://jsfiddle.net/GvdSy/
$.ajax({
xhr: function () {
var xhr = new window.XMLHttpRequest();
xhr.upload.addEventListener("progress", function (evt) {
if (evt.lengthComputable) {
var percentComplete = evt.loaded / evt.total;
}
@oswaldoacauan
oswaldoacauan / gist:6187053
Created August 8, 2013 18:05
Zend - Execute a string query
<?php
$stmt = $model->getAdapter()->query(
'SELECT * FROM bugs WHERE reported_by = ? AND bug_status = ?',
array('goofy', 'FIXED')
);
$rows = $stmt->fetchAll();