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 | |
define('ITERATIONS', 10000000); | |
$array = array( | |
'foo' => 'bar', | |
'baz' => 'zzz', | |
); | |
for ($i = 0; $i < ITERATIONS; $i++) { |
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
// Declares the CRUD operations (including the request parsing for filters, fields, sorts, …) | |
// Composed by a swappable DataResource. |
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
# Varnish caching | |
## List of 300 items | |
Requests per second: 6717.35 [#/sec] (mean) # RESTful Memcache render cache. | |
Requests per second: 7096.14 [#/sec] (mean) # RESTful Database render cache. | |
Requests per second: 6379.45 [#/sec] (mean) # RESTful No render cache. | |
Requests per second: 95.24 [#/sec] (mean) # RESTWS | |
Requests per second: 1125.62 [#/sec] (mean) # Services | |
## List of 50 items | |
Requests per second: 6632.03 [#/sec] (mean) # RESTful Memcache render cache. | |
Requests per second: 7057.74 [#/sec] (mean) # RESTful Database render cache. |
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 | |
class MyController extends ControllerBase implements ControllerInterface { | |
/** | |
* @var MyClass1 | |
* Object of Class 1 | |
*/ | |
protected $obj1; |
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
#!/bin/bash | |
cat <<EOF > /tmp/personal.json | |
{ | |
"git": { | |
"user": { | |
"name": "Enter your name", | |
"email": "your@email.sex" | |
}, | |
"core": { | |
"editor": "vi" |
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 | |
/** | |
* Implementation of hook_drush_command(). | |
*/ | |
function local_update_drush_command() { | |
$items = array(); | |
$items['local-update'] = array( | |
'description' => 'Downloads a dump of the remote database, suffixes that file with the current date and stores it in the selected location. After importing the database, it will run update hooks, revert all features, and clear cache. Once all this is finished, if everything is installed, the bundle command to rebuild all css will be run.', |
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
diff --git a/multifield.features.inc b/multifield.features.inc | |
index ca7a8ab..152ebc1 100644 | |
--- a/multifield.features.inc | |
+++ b/multifield.features.inc | |
@@ -30,3 +30,29 @@ function multifield_features_pipe_field_base_alter(&$pipe, $data, $export) { | |
} | |
} | |
} | |
+ | |
+/** |
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
# Based on the agnoster's Theme (https://gist.github.com/3712874) | |
# With some a couple of small changes. | |
# | |
# In order for this theme to render correctly, you will need a | |
# [Powerline-patched font](https://gist.github.com/1595572). | |
### Segment drawing | |
# A few utility functions to make it easy and re-usable to draw segmented prompts | |
CURRENT_BG='NONE' |
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
-- Select all media galleries and find all images in there that follow the path structure: public://images/%/%/%/% | |
SELECT n.nid, fmi.field_media_items_fid, file.uri | |
FROM | |
node n | |
INNER JOIN | |
field_data_field_media_items fmi ON fmi.entity_id = n.nid | |
INNER JOIN | |
file_managed file ON file.fid = fmi.field_media_items_fid | |
WHERE | |
n.type = 'media_gallery' |
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 | |
/** | |
* Implementation of hook_drush_command(). | |
*/ | |
function operations_drush_command() { | |
$items = array(); | |
$items['local-update'] = array( | |
'description' => 'Downloads a dump of the remote database, suffixes that file with the current date and stores it in the selected location. After importing the database, it will run update hooks, revert all features, and clear cache.', |