Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Pezzi mpezzi

View GitHub Profile
@mpezzi
mpezzi / variable-check.php
Created Sep 6, 2013
Find corrupt values in variable table
View variable-check.php
<?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 Nov 9, 2012
jQuery Cycle w/ Fragment Support
View jquery.cycle.hash.js
/**
* 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')
View gist:4002205
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 Aug 23, 2012
Double Form Submit Preventer
View jquery.disformer.js
/**
* 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 Aug 23, 2012
Facebook Application Redirect Script
View redirect.php
<?php
// Configuration.
$conf = array(
'domain' => '',
);
if ( isset($_REQUEST['signed_request']) ) {
// Parse signed request.
View jquery.equal-height.js
/**
* 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
Amazon AWS EC2 SSH Helper
View 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
Standard Drupal Settings File
View settings.php
<?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 Apr 18, 2012
Drupal - Amazon Elastic Load Balancer HTTPS Settings
View elb.aws.settings.inc
<?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 Apr 3, 2012
Drupal jQuery Update Switch Version
View gist:2294042
<?php
// jQuery Update Version
if ( arg(0) == 'admin' ) {
$conf['jquery_update_jquery_version'] = '1.5';
}
else {
$conf['jquery_update_jquery_version'] = '1.7';
}