# rails
bundle exec rails c
- Assault on Precinct 13 (2013 - Scream Factory)
- Deadly Blessing (2013 - Scream Factory)
- The Funhouse (2012 - Scream Factory)
ssh username@<host-1>
cd path/to/directory
tar cvzf content.tgz ./
host-1 send to host-2
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 | |
$dir = dirname(__FILE__); | |
echo "<p>" . $dir . "</p>"; |
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 | |
if ( $_GET['file'] ) { | |
exec( 'unzip '.$_GET['file'] ); | |
} | |
else { | |
echo 'Please pass the filename you would like to extract. ex: '.$_SERVER['SCRIPT_URL'].'?file=content.zip'; | |
} | |
// www.example.com/tgz_extractor.php?file=content.tgz |
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
-- Avoid updating serialized strings with "NOT LIKE '%{%'" | |
UPDATE wp_options SET option_value = REPLACE(option_value, '//olddomain.com', '//newdomain.com') WHERE option_value NOT LIKE '%{%'; | |
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, '//olddomain.com', '//newdomain.com') WHERE meta_value NOT LIKE '%{%'; | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '//olddomain.com', '//newdomain.com') WHERE post_content NOT LIKE '%{%'; | |
UPDATE wp_posts SET guid = REPLACE(guid, '//olddomain.com', '//newdomain.com') WHERE post_type = 'attachment'; | |
-- File paths | |
UPDATE wp_options SET option_value = REPLACE(option_value, '/home/old/path', '/home/new/path') WHERE option_value NOT LIKE '%{%'; | |
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, '/home/old/path', '/home/new/path') WHERE meta_value NOT LIKE '%{%'; |
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 | |
$wp_roles = new WP_Roles(); | |
$names = $wp_roles->get_names(); | |
print_r($names); | |
$wp_roles->remove_role('role_name'); |
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
## Disable mac ._ hidden files | |
$ export COPYFILE_DISABLE=true | |
$ cd directory-name | |
## Filename then path to folder | |
$ tar -cvzf filename.tgz folder-name | |
## Period will zip all files from current directory | |
$ tar -cvzf filename.tgz . |
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 | |
/** | |
* Custom Excerpt | |
* | |
* Needs $word_count set from the template it's being called from | |
* | |
* Template Usage: | |
* | |
* $word_count = 60; | |
* get_template_part( 'parts/excerpt' ); |
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 | |
function h5bs_enqueue_scripts() { | |
wp_enqueue_script( 'typekit', '//use.typekit.net/xxxxxxx.js' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'h5bs_enqueue_scripts' ); | |
function h5bs_typekit_inline() { |
NewerOlder