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 ( $includeDocs ) { | |
$ids = str_replace(' ','',$includeDocs); | |
$ids = explode(',', $ids); | |
$criteria = $modx->newQuery('modResource'); | |
$criteria->sortby('FIELD(modResource.id, '.implode(',',$ids).' )', 'ASC'); | |
$criteria->where(array( | |
'id:IN' => $ids | |
)); |
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 | |
/** | |
* Remove standard image sizes so that these sizes are not | |
* created during the Media Upload process | |
* | |
* Tested with WP 3.2.1 | |
* | |
* Hooked to intermediate_image_sizes_advanced filter | |
* See wp_generate_attachment_metadata( $attachment_id, $file ) in wp-admin/includes/image.php | |
* |
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
sass-convert -F css -T scss original_file.css converted_file.scss |
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
<[^>]*> |
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
var BrowserDetect = | |
{ | |
init: function () | |
{ | |
this.browser = this.searchString(this.dataBrowser) || "Other"; | |
this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown"; | |
}, | |
searchString: function (data) | |
{ |
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 | |
// Служебное письмо на forms@tokkipro.ru | |
include_once($_SERVER['DOCUMENT_ROOT'].'/path_to_file/tokki.php'); | |
$formdata = array( | |
'name' => $data['name'], | |
'phone' => $data['phone'], | |
'email' => $data['email'], | |
'message' => $data['message'], | |
'prim' => $data['some_data'], | |
); |
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 for registering wp_nav_menu() in 3 locations | |
add_action( 'init', 'register_navmenus' ); | |
function register_navmenus() { | |
register_nav_menus( array( | |
'Top' => __( 'Top Navigation' ), | |
'Header' => __( 'Header Navigation' ), | |
'Footer' => __( 'Footer Navigation' ), | |
) | |
); |
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
find . -type f \( -name '*.css' -o -name '*.js' -o -name '*.txt' -o -name '*.php' -o -name '*.htm' -o -name '*.html' \) -print0 | xargs -0 grep -l `printf '^\xef\xbb\xbf'` |
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 | |
// Счетчик Twitter с кэшированием | |
function nlt_getTwitterCounter($userID='androidbar') { | |
$output = get_transient('twitter_counter'); | |
if ( $output === false || $output == '' ) { | |
$data = json_decode(@file_get_contents('http://api.twitter.com/users/' . $userID .'.json')); | |
$output = $data->followers_count; | |
set_transient( 'twitter_counter', $output, 60*10 ); | |
} |
OlderNewer