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
{ | |
"version": "0.1.0", | |
"name": "pump", | |
"instructions": [ | |
{ | |
"name": "initialize", | |
"docs": [ | |
"Creates the global state." | |
], | |
"accounts": [ |
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
// call generateRandomUsername() | |
// example output: edward_cannon137 | |
// example output: thomas1295_deitz | |
// example output: tim2225_caswell31 | |
function generateRandomUsername() { | |
let firstnames = [ "Adam", "Alex", "Aaron", "Ben", "Carl", "Dan", "David", "Edward", "Fred", "Frank", "George", "Hal", "Hank", "Ike", "John", "Jack", "Joe", "Larry", "Monte", "Matthew", "Mark", "Nathan", "Otto", "Paul", "Peter", "Roger", "Roger", "Steve", "Thomas", "Tim", "Ty", "Victor", "Walter"]; | |
let lastnames = ["Anderson", "Ashwoon", "Aikin", "Bateman", "Bongard", "Bowers", "Boyd", "Cannon", "Cast", "Deitz", "Dewalt", "Ebner", "Frick", "Hancock", "Haworth", "Hesch", "Hoffman", "Kassing", "Knutson", "Lawless", "Lawicki", "Mccord", "McCormack", "Miller", "Myers", "Nugent", "Ortiz", "Orwig", "Ory", "Paiser", "Pak", "Pettigrew", "Quinn", "Quizoz", "Ramachandran", "Resnick", "Sagar", "Schickowski", "Schiebel", "Sellon", "Severson", "Shaffer", "Solberg", "Soloman", "Sonderling", "Soukup", "Soulis", "Stahl", "Sweeney", "Tandy", |
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 dictionary = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean augue magna, aliquet vitae finibus vel, semper a arcu. Sed pretium dignissim consectetur. Ut diam diam, volutpat ut orci non, laoreet elementum justo. Nulla imperdiet odio ante, vulputate cursus ipsum mollis et. Donec dictum, dolor varius tempus dapibus, ante ligula bibendum leo, nec semper libero enim a leo. Nulla aliquet massa ac sem finibus fringilla. Vestibulum ut euismod dui. Morbi sit amet mollis velit. Maecenas id sapien ut risus efficitur fermentum vestibulum vitae purus. Sed ultrices magna vitae elit ultricies, vitae placerat tellus aliquet. Vivamus sit amet luctus augue. Nunc sit amet eleifend mauris, eu elementum est. Proin tempor enim odio, in sagittis est porta vestibulum. Duis lobortis in nisi a placerat. Cras eu volutpat lacus, vitae malesuada sapien. Cras vestibulum urna tellus, in sagittis massa facilisis vitae. Proin maximus sodales eros, id elementum arcu aliquam a. Quisque eget enim et velit maximus scelerisq |
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 | |
/** | |
* Overrides anycomment template on WooCommerce single product page. | |
* | |
* @param $theme_template | |
* | |
* @return string | |
*/ | |
function anycomment_woocommerce_override( $theme_template ) { | |
if ( class_exists( 'WooCommerce' ) && is_product() ) { |
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
/** | |
* Ждем пока в DOM появится элемент с указанным селектором | |
* и вызовем колбек в момент появления. | |
* | |
* @param selector | |
* @param callback | |
*/ | |
function waitForEl( selector, callback ) { | |
var poller = setInterval( | |
function() { |
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 | |
// Функцию ниже нужно добавить в functions.php вашей темы | |
// Пример вывода в single.php: echo ac_get_post_rating(get_the_ID()); | |
/** | |
* Возвращает рейтинг записи по ID записи. | |
* | |
* @see \AnyComment\Models\AnyCommentRating::get_average_by_post() для подробной информации. | |
* @return float | |
*/ |
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 | |
add_filter( 'woocommerce_product_tabs', 'sb_woo_remove_reviews_tab', 1000); | |
function sb_woo_remove_reviews_tab($tabs) { | |
unset($tabs['reviews']); | |
return $tabs; | |
} |
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 | |
// Только без "<?php" выше | |
add_filter( 'minit-exclude-js', function($excludes) { | |
$excludes[] = 'anycomment-js-bundle'; | |
return $excludes; | |
}); |
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
/* | |
* message - сообщение, которое будет опубликовано | |
* image - картинка для постинга | |
* user_id - id текущего пользователя (к нему будет осуществлён постинг) | |
*/ | |
function wallPost(message, image, user_id) { | |
VK.api('photos.getWallUploadServer', { | |
uid: user_id | |
}, function (data) { | |
if (data.response) { |
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 | |
/** | |
* Disable admin bar for users who cannot manage options. | |
*/ | |
function anycomment_disable_admin_bar() { | |
if ( is_plugin_active( 'anycomment/anycomment.php' ) ) { | |
if ( ! current_user_can( 'manage_options' ) ) { | |
show_admin_bar( false ); | |
} |
NewerOlder