Skip to content

Instantly share code, notes, and snippets.

@kadavre
kadavre / image.php
Created September 4, 2013 09:48 — forked from bchapuis/image.php
<?php
class ImageHelper extends Helper {
var $helpers = array('Html');
var $cacheDir = 'cache'; // relative to IMAGES_URL path
function resize($path, $dst_w, $dst_h, $htmlAttributes = array(), $return = false) {
$types = array(1 => "gif", "jpeg", "png", "swf", "psd", "wbmp"); // used to determine image type
@kadavre
kadavre / prevent-multiple-submite.js
Created August 5, 2013 08:22
Prevent Multiple Submit of Your Form
$(document).ready(function() {
$('form').submit(function() {
if(typeof jQuery.data(this, "disabledOnSubmit") == 'undefined') {
jQuery.data(this, "disabledOnSubmit", { submited: true });
$('input[type=submit], input[type=button]', this).each(function() {
$(this).attr("disabled", "disabled");
});
return true;
}
else