Skip to content

Instantly share code, notes, and snippets.

Nicola Peluchetti nicoladj77

Block or report user

Report or block nicoladj77

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:00e448388cb356bc50f28ef3b4afcc6c
[{
"id": "2.30063746",
"date": "",
"date_gmt": "",
"guid": [],
"modified": "",
"modified_gmt": "",
"slug": "",
"type": "attachment",
"link": "http:\/\/pa-images-static.imgix.net\/v2\/image\/preview\/d85355165f86fd88b4fb85d5f9dbf5a0Y29udGVudCwxNDg2OTAxNjkw\/2.30063746.jpg",
View casper.js
var configLocal = {
undefeatedUrl: 'http://vip.local/espn',
fteUrl: 'http://vip.local/fivethirtyeight',
grantlandUrl: 'http://vip.local/grantland'
}
casper.test.begin( 'Login to wordpress', 3, function suite( test ) {
var jsErrors = [];
casper.on( "page.error", function ( msg, trace ) {
this.echo( "Error: " + msg, "ERROR" );
this.echo( "file: " + trace[0].file, "WARNING" );
View gist:932b8da25b87ad2d9dd9
function bugs_update_content_split_terms( $old_term_id, $new_term_id, $term_taxonomy_id, $taxonomy ) {
$term_meta = get_option( 'taxonomy_' . $old_term_id );
if ( 'espn_bug' === $taxonomy && $term_meta ) {
// We have a match, so we swap out the old tag ID for the new one and resave the option.
update_option( 'taxonomy_' . $new_term_id, $term_meta );
}
}
add_action( 'split_shared_term', 'bugs_update_content_split_terms', 10, 4 );
View Alter TABLE if install fails.
ALTER TABLE wp_ai1ec_events MODIFY COLUMN `start` INT(10) UNSIGNED NOT NULL;
ALTER TABLE wp_ai1ec_events MODIFY COLUMN `end` INT(10) UNSIGNED;
ALTER TABLE wp_ai1ec_event_instances MODIFY COLUMN `end` INT(10) UNSIGNED NOT NULL;
ALTER TABLE wp_ai1ec_event_instances MODIFY COLUMN `start` INT(10) UNSIGNED NOT NULL;
View restore events instances
UPDATE wp_ai1ec_event_instances, wp_ai1ec_event_instances_restore
SET wp_ai1ec_event_instances.`end` = UNIX_TIMESTAMP(wp_ai1ec_event_instances_restore.`end`)
WHERE wp_ai1ec_event_instances.id = wp_ai1ec_event_instances_restore.id
@nicoladj77
nicoladj77 / Restore events
Created Jul 29, 2013
Recover start from Restore
View Restore events
UPDATE wp_ai1ec_events, wp_ai1ec_events_restore
SET wp_ai1ec_events.`start` = UNIX_TIMESTAMP(wp_ai1ec_events_restore.`start`)
WHERE wp_ai1ec_events.post_id = wp_ai1ec_events_restore.post_id
@nicoladj77
nicoladj77 / Front end modal not showing corretcly
Last active Dec 18, 2015
gist for modal not showing up correctly
View Front end modal not showing corretcly
jQuery('#ai1ec-create-event-modal').parents().each(function(){
var $this = jQuery(this);
var position = $this.css('position');
if( position === 'relative' ) {
console.log(this);
$this.css('position', 'static');
}
});
View Register shutdown function
function shutdown() {
$error = error_get_last();
echo '<pre>';
var_dump($error);
echo '</pre>';
}
register_shutdown_function('shutdown');
View apc.php
<?php
/*
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2011 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
You can’t perform that action at this time.