Skip to content

Instantly share code, notes, and snippets.

View mpezzi's full-sized avatar

Michael Pezzi mpezzi

View GitHub Profile
@mpezzi
mpezzi / variable-check.php
Created September 6, 2013 18:40
Find corrupt values in variable table
<?php
$result = db_select('variable', 'v')
->fields('v', array('name', 'value'))
->orderBy('name', 'ASC')
->execute()
->fetchAll();
$rows = array();
foreach ($result as $row) {
@mpezzi
mpezzi / jquery.cycle.hash.js
Created November 9, 2012 01:49
jQuery Cycle w/ Fragment Support
/**
* jQuery Cycle w/ Fragment Support by M. Pezzi
* Dual licensed under the MIT and GPL licences:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Requires: jQuery v1.4 or later
*/
$(function(){
var $cycle = $('#cycle .cycle-inner')
index: function(req, res) {
models.user.findAll().success(function(users){
console.log(users);
var users = _.map(users, function(user){
user.getProfile().success(function(profile){
user.profile = profile;
});
return user;
@mpezzi
mpezzi / jquery.disformer.js
Created August 23, 2012 21:43
Double Form Submit Preventer
/**
* jQuery Double Form Submit Preventer Plugin by M. Pezzi
* Version: 1.0-alpha (08/23/12)
* Dual licensed under the MIT and GPL licences:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Requires: jQuery v1.4.2 or later
*/
;(function($){
@mpezzi
mpezzi / redirect.php
Created August 23, 2012 18:03
Facebook Application Redirect Script
<?php
// Configuration.
$conf = array(
'domain' => '',
);
if ( isset($_REQUEST['signed_request']) ) {
// Parse signed request.
@mpezzi
mpezzi / jquery.equal-height.js
Created August 14, 2012 02:28
jQuery Equal Heights
/**
* jQuery Equal Height Plugin by M. Pezzi
* Version: 1.0-alpha (08/13/12)
* Dual licensed under the MIT and GPL licences:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Requires: jQuery v1.4.2 or later
*/
(function($) {
@mpezzi
mpezzi / ec2-ssh-helper
Created May 3, 2012 22:36
Amazon AWS EC2 SSH Helper
#!/bin/bash
AWS_KEY=""
AWS_SECRET=""
if [ $# -ne 1 ]
then
ec2-host --aws-key $AWS_KEY --aws-secret $AWS_SECRET
else
ssh -i ~/.ssh/key.pem ec2-user@$(ec2-host --aws-key $AWS_KEY --aws-secret $AWS_SECRET $1)
@mpezzi
mpezzi / settings.php
Created May 2, 2012 18:39
Standard Drupal Settings File
<?php
/**
* @file
* Provides settings.
*/
ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 100);
ini_set('session.gc_maxlifetime', 200000);
@mpezzi
mpezzi / elb.aws.settings.inc
Created April 18, 2012 13:17
Drupal - Amazon Elastic Load Balancer HTTPS Settings
<?php
/**
* @file
* Amazon Elastic Load Balancer Settings.
*
* Force server to use https:// path if SSL is handled at load balancer.
*
* @see http://drupal.org/node/185161#comment-5452038
*/
@mpezzi
mpezzi / gist:2294042
Created April 3, 2012 17:44
Drupal jQuery Update Switch Version
<?php
// jQuery Update Version
if ( arg(0) == 'admin' ) {
$conf['jquery_update_jquery_version'] = '1.5';
}
else {
$conf['jquery_update_jquery_version'] = '1.7';
}