Skip to content

Instantly share code, notes, and snippets.

View handrus's full-sized avatar

Handrus Stephan Nogueira handrus

View GitHub Profile
@handrus
handrus / Crud.php
Created December 2, 2011 16:43
Classe abstrata de crud
<?php
/**
* Classe abstrata para funcionalidade de CRUD
* @author Daniel Lima <[email protected]>
* @example
* <code>
* <?php
* Module_Foo_Controller extexds Cilens_Controller_Crud
* {
* protected $_modelName = 'Foo';
@handrus
handrus / pre-commit
Last active August 29, 2015 13:56 — forked from skwashd/pre-commit
#!/bin/bash
#
# Git pre-commit hook for Drupal projects.
# Created by Dave Hall - http://davehall.com.au
#
# Changed by Handrus Nogueira and Luiz Petri
#
# Distributed under the terms of the WTFPL - http://www.wtfpl.net/
#
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_objects import RGBColor
import argparse
import math
@handrus
handrus / pubsub.js
Last active August 29, 2015 14:16 — forked from weslleyaraujo/pubsub.js
/**
* @method: PubSub
* */
;(function(global) {
'use strict';
function PubSub () {
this.topics = {};
};
@handrus
handrus / prevent_double_click.js
Created March 10, 2016 01:51 — forked from pangui/prevent_double_click.js
Prevent double click!
// jQuery plugin to prevent double click
jQuery.fn.preventDoubleClick = function() {
$(this).on('click', function(e){
var $el = $(this);
if($el.data('clicked')){
// Previously clicked, stop actions
e.preventDefault();
e.stopPropagation();
}else{
// Mark to ignore next click