This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This will replace the default values with new ones, within the rendered content of newsletters | |
*/ | |
add_filter( 'mailpoet_rendering_post_process', function ( $content ) { | |
$max_width = 900; | |
$width_mapping = [ | |
660 => $max_width, | |
330 => abs( $max_width / 2 ), | |
220 => abs( $max_width / 3 ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is a replacement for NextGens "singlepic" shortcode | |
*/ | |
add_shortcode('singlepic', 'render_shortcode_nextgen_singlepic_replacement'); | |
function render_shortcode_nextgen_singlepic_replacement($attributes = array()) { | |
/** @global wpdb $wpdb */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_shortcode('wpml_link', array($this, 'render_wpml_link')); | |
function render_wpml_link($attributes) { | |
$attributes = shortcode_atts( | |
array( | |
'code' => 'de', | |
), $attributes); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Requirements: | |
-- * Users won't get any emails, when doing some test | |
-- * We get all emails | |
-- | |
START TRANSACTION; | |
-- You may set this to the correct value, if you get error #1267 | |
-- SET collation_connection = 'utf8_general_ci'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(item in Jenkins.instance.items) { | |
println("Deleting builds of job "+item.name) | |
counter = 1 | |
for(build in item.getBuilds()){ | |
if(counter > 5){ | |
println("Delete " + build.number) | |
try{ | |
build.delete() | |
}catch(Exception e){ | |
println(e.getMessage()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Source: http://wordpress.org/support/topic/changed-table-prefix-got-insufficient-permissions-error#post-713055 | |
UPDATE new_usermeta | |
SET meta_key = REPLACE(meta_key,'old_','new_'); | |
UPDATE new_options | |
SET option_name = REPLACE(option_name,'old_','new_'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in `find ${WORKSPACE}/../../*/workspace -type d -maxdepth 1`; do | |
if [ -d "$i/.git" ]; then | |
cd $i | |
git gc | |
fi | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in `find ${WORKSPACE}/../../*/workspace -type d -maxdepth 1`; do | |
cd $i || true | |
svn upgrade || true | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -r /opt/jenkins/home/jobs/*/workspace/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jenkins.model.* | |
for(item in Jenkins.instance.items) { | |
if(item.scm instanceof hudson.plugins.git.GitSCM){ | |
println("JOB : "+item.name) | |
print("useShallowClone: " + item.scm.useShallowClone) | |
item.scm.useShallowClone=true | |
println(" => "+item.scm.useShallowClone) | |
println("\n=======\n") | |
item.save() |