This file contains 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
#!/bin/bash | |
COMMAND="echo \"*** Starting unlock procedure...\";" | |
COMMAND="$COMMAND /usr/sbin/mariadbd --verbose --user=root --skip-grant-tables 2>/tmp/mariadbd.err &" | |
COMMAND="$COMMAND echo -n \"*** Waiting for database connection\";" | |
COMMAND="$COMMAND until mariadb -e 'SELECT 1' 2>/tmp/mariadb.err 1>/tmp/mariadb.err; do echo -n '.'; done; echo;" | |
COMMAND="$COMMAND echo '*** Connected! Setting root password to: $1';" | |
COMMAND="$COMMAND mariadb -e \"FLUSH PRIVILEGES; ALTER USER 'root'@'localhost' IDENTIFIED BY '$1'; SHUTDOWN;\" &" |
This file contains 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 changes logging to only log fatal errors. This file should go in your mu-plugins directory. | |
*/ | |
// Set the error logging to only log fatal errors | |
error_reporting( E_ERROR ); | |
// Optional: change the location of your error log, it might be wise to put it outside your WP content dir. | |
// If you don't change it, the default place for this log is debug.log in your WP_CONTENT_DIR. |
This file contains 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
# Save this file as lib/capistrano/tasks/git.cap | |
namespace :git do | |
desc 'Copy repo to releases' | |
task create_release: :'git:update' do | |
on roles(:all) do | |
with fetch(:git_environmental_variables) do | |
within repo_path do | |
execute :git, :clone, '-b', fetch(:branch), '--recursive', '.', release_path | |
end |
This file contains 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 little class records how long it takes each WordPress action or filter | |
* to execute which gives a good indicator of what hooks are being slow. | |
* You can then debug those hooks to see what hooked functions are causing problems. | |
* | |
* This class does NOT time the core WordPress code that is being run between hooks. | |
* You could use similar code to this that doesn't have an end processor to do that. | |
* |
This file contains 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
#!/bin/sh | |
rsync="/usr/bin/rsync" | |
################################ | |
# VARIABLES | |
################################ | |
# General Variables | |
remote_server="yourserver.com" | |
remote_port="22" |
This file contains 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 | |
$revision_regex = '/^r(\d+) /'; | |
exec( 'svn log | sed \'s/------------------------------------------------------------------------/NEWCHANGESET/g\' | sed -e \'/[^NEWCHANGESET]$/{N;s/\n//;}\' | sed -e \'/[^NEWCHANGESET]$/{N;s/\n//;}\' | sed -e \'s/NEWCHANGESET//\'', $commits ); | |
foreach( $commits as $commit ) { | |
if( !$commit ) | |
continue; | |
preg_match( $revision_regex, $commit, $revision ); |
This file contains 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
// swap the keybindings for paste and paste_and_indent | |
{ "keys": ["super+v"], "command": "paste_and_indent" }, | |
{ "keys": ["super+shift+v"], "command": "paste" } |
This file contains 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 | |
/** | |
* Takes posts that are in category A and also adds them to category B | |
*/ | |
// Uncomment this to proceed | |
exit( "You need to edit the file and enter the hostname and category IDs.\n" ); | |
// What blog? Asking for both for safety reasons. |
This file contains 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
<input type="text" name="my-theme-options[color]" id="color" /> | |
<input type='button' class='pickcolor button-secondary' value='Select Color'> | |
<div id='colorpicker' style='z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;'></div> | |
// Color Picker for js file | |
$('.pickcolor').click( function(e) { | |
colorPicker = jQuery(this).next('div'); | |
input = jQuery(this).prev('input'); | |
$(colorPicker).farbtastic(input); | |
colorPicker.show(); |