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
#Fix WP URLs | |
SET @oldurl = 'http://staging.windfarmstudios.net'; | |
SET @newurl = 'http://staging.wubdfarnstyduis.com'; | |
UPDATE wm_wp_options SET option_value = REPLACE(option_value, @oldurl, @newurl); | |
UPDATE wm_wp_posts SET guid = REPLACE (guid, @oldurl, @newurl); | |
UPDATE wm_wp_posts SET post_content = REPLACE (post_content, @oldurl, @newurl); |
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 uploads for Products to a products subdir & Artists to an Artist dir | |
function reroute_upload_dir ( $pathdata ) { | |
$post_type = ( isset( $_POST['post_id'] ) ) ? get_post_type( $_POST['post_id'] ) : false; | |
if ( $post_type == 'product' ) { | |
$subdir = '/products'; | |
} elseif ( $post_type == 'artists' ) { | |
$subdir = '/artists'; | |
} elseif ( $post_type === 'post' ) { |
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
<html> | |
<head> | |
<title>Stripe Fun</title> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.1.min.js"></script> | |
<script type="text/javascript" src="https://js.stripe.com/v2/"></script> | |
<script type="text/javascript"> | |
Stripe.setPublishableKey('pk_2V6rBH5IilzAezJ8K9fcpOkYT7VJf'); | |
jQuery(function($) { | |
$('#payment-form').submit(function(event) { | |
var $form = $(this); |
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
Align Equals: Command + Control + a |
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
printf '\nTOKEN: %s\n' "$auth_token" | |
printf 'STORAGE: %s\n\n' "$storage_url" | |
store="need_encoding.log" | |
comm -23 <(swift list "audio-in" | sed 's/.mp3//') <(swift list "audio-out" | sed 's/.ogg//') > "$store" | |
counter=0 | |
total=$(wc -l <"$store") | |
while read -r line; do | |
((counter++)) |
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 | |
# The goal of this script is to delete any files under 1mb (1048576 bytes) | |
while read -r file; do | |
length=$(swift stat audio-in "$file" | grep 'Content Length' | sed 's/Content Length: //') | |
#echo "Length is: $length" | |
if (( length < 1048576 )) ; then | |
swift delete audio-in "$file" | |
#echo "deleting $file" |
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 | |
# The goal of this script is to remove mp3's that have already been processed | |
temp_file='/tmp/music-dup.txt' | |
comm -12 <(swift list 'audio-in' | sed 's/.mp3//') <(swift list 'audio-out' | sed 's/.ogg//') > $temp_file | |
while read -r line; do | |
echo "removing item: $line.mp3" |
NewerOlder