Example for terminology:
- hook = hook
- themeID = node
- suggestionID = article
hook_theme()
| <?php | |
| function template_preprocess_page(&$variables) { | |
| $language_interface = language(LANGUAGE_TYPE_INTERFACE); // DC | |
| $site_config = config('system.site'); // DC | |
| // Move some variables to the top level for themer convenience and template cleanliness. | |
| $variables['show_messages'] = $variables['page']['#show_messages']; // Bad | |
| foreach (system_region_list($GLOBALS['theme']) as $region_key => $region_name) { | |
| if (!isset($variables['page'][$region_key])) { |
| /** | |
| * Prepares variables for HTML document templates. | |
| * | |
| * Default template: html.html.twig. | |
| * | |
| * @param array $variables | |
| * An associative array containing: | |
| * - page: A render element representing the page. | |
| * | |
| * @see system_elements() |
| function Foo(who) { | |
| this.me = who; | |
| } | |
| Foo.prototype.identify = function() { | |
| return "I am " + this.me; | |
| }; | |
| function Bar(who) { | |
| Foo.call(this,"Bar:" + who); |
I had a look at calls to _preprocess_html and _process_html and what they do in core. I've listed what we need to provide and a summary of existing implementations.
It seems that everything existing in core can be potentially solved by:
<body> tag and the <html> tag. Most of the time, it's class attributes, but RDFa will have other needs.drupal_add_js, etc. We're already talking about this in core.and tags, and the tag, all within. This is on sdboyer's radar.| Array | |
| ( | |
| [hook_menu] => 6744 | |
| [hook_uninstall] => 4742 | |
| [hook_perm(ission)] => 4012 | |
| [hook_install] => 3751 | |
| [hook_theme] => 3525 | |
| [hook_schema] => 3003 | |
| [hook_help] => 2465 | |
| [hook_form_alter] => 2273 |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
| This playbook has been removed as it is now very outdated. |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "io/ioutil" | |
| "log" | |
| "code.google.com/p/go.crypto/ssh" | |
| "code.google.com/p/go.crypto/ssh/terminal" |