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
| document.body.addEventListener('dragover', function(e) { | |
| e.preventDefault() | |
| return false; | |
| }); | |
| document.body.addEventListener('drop', function(e) { | |
| e.preventDefault() | |
| return false; | |
| }); |
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
| function is_subscriber() { | |
| // Test if role is subscriber | |
| $cu = wp_get_current_user(); | |
| if (!empty($cu->roles) && is_array($cu->roles)) { | |
| if(in_array('subscriber', $cu->roles)) { | |
| return true; | |
| } | |
| } | |
| return false; | |
| } |
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
| #!/bin/bash | |
| mkdir ~/ezSetupTemp | |
| cd ~/ezSetupTemp | |
| # Install RVM & Ruby | |
| sudo curl -L https://get.rvm.io | sudo bash -s stable --ruby | |
| # Install Homebrew | |
| ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" |
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
| #!/bin/bash | |
| mkdir ~/getmacapps_temp | |
| cd ~/getmacapps_temp | |
| # Installing Chrome | |
| curl -L -O "https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg" | |
| hdiutil mount googlechrome.dmg | |
| cp -R "/Volumes/Google Chrome/Google Chrome.app" /Applications | |
| hdiutil unmount "/Volumes/Google Chrome" |
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_action('template_redirect', function() { | |
| if( is_404() ) { | |
| $uri = $_SERVER["REQUEST_URI"]; | |
| if( preg_match('%.jpg|.png|.jpeg|.gif%', $uri, $matches) ) { | |
| header('HTTP/1.0 404 Not Found'); | |
| echo "<h1>404 - Image Not Found</h1>"; | |
| echo "The page that you have requested could not be found."; | |
| exit(); |
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
| [xdebug] | |
| xdebug.remote_enable=1 | |
| xdebug.remote_connect_back = 1 | |
| xdebug.remote_port=9000 | |
| xdebug.remote_autostart=1 | |
| xdebug.remote_handler=dbgp | |
| xdebug.remote_host = 127.0.0.1 | |
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
| function find_and_replace($needle, &$haystack) { | |
| if(strpos($haystack, $needle) !== false) { | |
| $haystack = preg_replace('|' . preg_quote($needle) . '|', '', $haystack); | |
| } | |
| } | |
| /** | |
| * This function makes relative urls from all absolute urls of the current domain. | |
| * | |
| * |
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
| /* | |
| Replace wp_options and wp_posts with the table names in your database | |
| You may have used a different prefix for the table names besides wp_ | |
| Obviously plugins may store their own urls, you're own your own to incorporate these statements into something usable for that. | |
| */ |
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 | |
| /** | |
| * Created by PhpStorm. | |
| * User: skohlmeyer | |
| * Date: 3/27/14 | |
| * Time: 2:27 PM | |
| */ | |
| /* | |
| Usage: |