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
openserver, xdebug, xcallgraph | |
xdebug.profiler_enabled=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
<?php | |
/** | |
* Drupal 7 create node programmatically. | |
* | |
* @see https://www.drupal.org/node/1173136, important! - read comments below post. | |
* | |
* also @see http://www.lightrains.com/blog/programmatically-create-node-drupal-7, better explanation. | |
* also @see http://fooninja.net/2011/04/13/guide-to-programmatic-node-creation-in-drupal-7/ | |
*/ |
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
Вопрос: Как решить любую задачу? | |
Преамбула: | |
Быстрый способ, касается как компьютерных так и бытовых задач. | |
Тоесть это для тех кто стремиться к эффективности в своей жизни. | |
Дело в том что человечество накопило массу знаний, а в последнее время они ещё и хорошо организованы и легко находимы. | |
Многие из наших действий, как это ни странно может показаться, типичны. | |
Конечно же это касается тех действий, которые легко понять "в теории", и использовать знания для практики. | |
Ответ: Гугл! |
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 | |
$entity_type = 'node'; | |
$bundle_name = 'gift'; | |
$fields = field_info_instances($entity_type, $bundle_name); | |
$options = array(); | |
foreach ($fields as $name => $field) { | |
$options[$name] = $field['label']; | |
} | |
$form['field_price'] = array( | |
'#type' => 'select', |
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($) { | |
$(function(){ | |
// jquery.ui.dialog init | |
$('.onpay-form').dialog({ | |
autoOpen: false, | |
show: { | |
effect: 'slideDown', | |
duration: 100 | |
}, |
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 | |
// node_types select options | |
$types = node_type_get_types(); | |
foreach($types as $node_type) { | |
$options[$node_type->type] = $node_type->name; | |
} | |
$form['onpay']['onpay_node_types'] = array( | |
'#type' => 'select', | |
'#title' => t('Node types'), | |
'#options' => $options, |
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 | |
/** | |
* See: | |
* https://www.lullabot.com/blog/article/beginners-guide-caching-data-drupal-7 | |
*/ | |
// example 1 | |
function my_module_function() { | |
$my_data = &drupal_static(__FUNCTION__); |
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 | |
/** | |
* See: | |
* http://stackoverflow.com/questions/6619377/how-to-get-whole-and-decimal-part-of-a-number | |
*/ | |
// get whole and fraction parts of decimal value | |
$amount = 1.25; | |
$whole = floor($amount); // 1 | |
$fraction = $amount - $whole; // .25 | |
?> |
NewerOlder