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 | |
| class Weixin { | |
| public function __construct($postStr) { | |
| if( !empty($_GET['echostr']) && $this->check_signature() ) { | |
| echo $_GET['echostr']; | |
| return; | |
| } | |
| if( empty($postStr) ) { |
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 | |
| //Disable Theme Updates | |
| # 2.8 to 3.0: | |
| remove_action( 'load-themes.php', 'wp_update_themes' ); | |
| remove_action( 'load-update.php', 'wp_update_themes' ); | |
| remove_action( 'admin_init', '_maybe_update_themes' ); | |
| remove_action( 'wp_update_themes', 'wp_update_themes' ); | |
| add_filter( 'pre_transient_update_themes', create_function( '$a', "return null;" ) ); | |
| wp_clear_scheduled_hook( 'wp_update_themes' ); |
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 | |
| //Options Page Configuration | |
| function admin_init_callback() { | |
| register_setting( 'msp_settings', 'msp_duration' ); | |
| add_settings_section( 'msp_settings', __('Multisite Posts Configuration'), false, 'general' ); | |
| add_settings_field( 'msp_duration', __('Cache Duration'), array($this, 'msp_settings_callback'), 'general', 'msp_settings', array( | |
| "id" => "msp_duration", |
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
| var url = require("url"); | |
| var http = require("http"); | |
| var jsdom = require("jsdom"); | |
| var request = require("request"); | |
| var server = http.createServer( function( top_request, top_response ) { | |
| var pathname = top_request.url.split("/"); | |
| var uri_path = ""; | |
| if( "author" === pathname[1] && | |
| pathname[2] ) { |
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
| root@angelawang:/var/www/node/scraper# node main.js | |
| /var/www/node/scraper/main.js:16 | |
| if(err) throw err; | |
| ^ | |
| Error: Invalid URI "undefined" | |
| at Request.init (/var/www/node/scraper/node_modules/request/index.js:205:24) | |
| at new Request (/var/www/node/scraper/node_modules/request/index.js:124:8) | |
| at Function.request [as get] (/var/www/node/scraper/node_modules/request/index.js:1275:11) | |
| at Server.<anonymous> (/var/www/node/scraper/main.js:12:10) |
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 | |
| function attachMediaFromUrl( $url, $post_id = 0, $file_type = null ) { | |
| //Fetch Media And Set Path | |
| require_once( ABSPATH . 'wp-admin/includes/image.php' ); | |
| $upload_dir = wp_upload_dir(); | |
| $file_name = basename( $url ); | |
| $image_data = @file_get_contents( $url ); | |
| $file = wp_mkdir_p( $upload_dir['path'] ) ? $upload_dir['path'] : $upload_dir['basedir']; | |
| $file .= '/' . $file_name; |
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_filter( 'style_loader_src', 'idu_remove_version_no', 9999 ); | |
| add_filter( 'script_loader_src', 'idu_remove_version_no', 9999 ); | |
| //Hack to get rid of the bloody automatic version no | |
| function idu_remove_version_no($src) { | |
| if ( strpos( $src, 'ver=' ) ) { | |
| $src = remove_query_arg( 'ver', $src ); | |
| } |
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 | |
| class Idu_Taxonomy { | |
| function __construct($taxonomy) { | |
| $this->taxonomy = $taxonomy; | |
| $this->taxonomy["singular"] = $this->prepare_name($taxonomy["singular"]); | |
| $this->taxonomy["plural"] = $this->prepare_name($taxonomy["plural"]); | |
| if("tax" == $taxonomy["type"]) { |
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
| var mongoose = require('mongoose'); | |
| var http = require('http'); | |
| mongoose.connect("mongodb://localhost/shortener"); | |
| var db = mongoose.connection; | |
| db.on('error', console.error.bind(console, 'connection error:')); | |
| db.once('open', function() { | |
| var urlSchema = mongoose.Schema({ | |
| slug: String, |