ეს მთავარ გვერდზე გამოგვადგება ახალი დოკუმენტების ლისტებისთვის iphoneზე
ეს რეგისტრაციაზე ან ჶილდების ვალიდაციაზე ზოგადად
var each = function(callback){ | |
return function(array){ | |
for(var i = 0;i < array.length; i++){ | |
var arg = [].slice.call(arguments); | |
arg[0] = array[i]; | |
callback.apply(this,arg); | |
} | |
}; | |
}; |
function storer(key, val) { | |
if (arguments.length === 1) | |
return this[key]; | |
else if (arguments.length === 0) | |
return this; | |
if (typeof val === "function") | |
return function () { | |
return val.apply(storer.bind(this, key), arguments); | |
}.bind(this); | |
setTimeout(console.log.bind(console, this), 1); |
function arrayToFuncs() { | |
var functions = arguments; | |
return function (args) { | |
return [].map.call(functions, function (func, i) { | |
if (func == null)return args[i]; | |
return func.call(undefined, args[i]); | |
}); | |
} | |
} |
/* | |
// implementation 1 | |
function memoize(func){ | |
var store = {}; | |
return function recursive(a){ | |
if(store[a] == null) { | |
store[a] = func(recursive,a); | |
} | |
return store[a]; | |
}; |
<?php | |
/** | |
* Implements hook_module_implements_alter(). | |
*/ | |
function MODULE_NAME_module_implements_alter(&$implementations, $hook) { | |
if ($hook == 'block_list_alter') { | |
// We need our module to run hook_block_list_alter() first. | |
$module = 'MODULE_NAME'; | |
// Pull out our own hook implementation details. | |
$group = array($module => $implementations[$module]); |
Drupal Web Services |
function args2Obj () { | |
var keys = Array.prototype.slice.apply(arguments); | |
return function () { | |
var values = Array.prototype.slice.apply(arguments); | |
return keys.reduce(function (result,key,index) { | |
result[key] = values[index]; | |
return result; | |
},{}); | |
}; | |
}; |
//from : http://drupal.stackexchange.com/questions/30904/retrieve-a-field-value-without-loading-the-entire-node | |
function load_field_values($field_name, $entity_type, $bundle, $nids) { | |
$query = db_select("field_revision_{$field_name}", 'f') | |
->fields('f', array('entity_id', "{$field_name}_value")) | |
->condition('entity_type', $entity_type); | |
if ($bundle) | |
$query->condition('bundle', $bundle); | |
$query | |
->condition('entity_id', $nids, 'IN') |
ეს მთავარ გვერდზე გამოგვადგება ახალი დოკუმენტების ლისტებისთვის iphoneზე
ეს რეგისტრაციაზე ან ჶილდების ვალიდაციაზე ზოგადად
#import <UIKit/UIKit.h> | |
@interface UILabel (AutoResizeingFix) | |
@end |