Example for terminology:
- hook = hook
- themeID = node
- suggestionID = article
hook_theme()
/** | |
* 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() |
<?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])) { |
To use, place the code in version_trick.go
in your project. Don't forget to change the namespace to match yours to the actual name of your package.
In addition to version_trick.go
, there's a makefile-snippet, that includes the secret sauce for making this trick
work. Be sure to change the package name there as well.
Enjoy!
P.S. Special thanks to @meatballhat by way of @syscomet for showing me this trick!
alias gdbnew='/usr/local/Cellar/gdb/7.6/bin/gdb' |
There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.
So, these are the different settings we are going to compare:
language: php | |
# | |
# Important to note, this is the version of PHP used to run this build, not the | |
# one used to run your Drupal installation. Ensure compatibility with the Drush | |
# and Terminus versions you're using for this build. | |
# | |
php: | |
- 5.3 |
You appear to be advocating a new: | |
[ ] cloud-hosted [ ] locally installable [ ] web-based [ ] browser-based [ ] language-agnostic | |
[ ] language-specific IDE. Your IDE will not succeed. Here is why it will not succeed. | |
You appear to believe that: | |
[ ] Syntax highlighting is what makes programming difficult | |
[ ] Garbage collection is free | |
[ ] Computers have infinite memory | |
[ ] Nobody really needs: |
WebSockets is a modern HTML5 standard which makes communication between client and server a lot more simpler than ever. We are all familiar with the technology of sockets. Sockets have been fundamental to network communication for a long time but usually the communication over the browser has been restricted. The general restrictions
// Copyright (c) 2017 Ismael Celis | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// The above copyright notice and this permission notice shall be included in all |