View opcache-largest-offenders.php
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 | |
// This code checks for largest opcache consumers | |
$status = opcache_get_status(); | |
// remap | |
foreach ($status['scripts'] as $path => $script) { | |
$sizes[$path] = $script['memory_consumption']; | |
} |
View unison.sh
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 | |
apt-get update | |
apt-get install libdpkg-perl -y -f --allow-downgrades | |
apt-get install ocaml ocaml-native-compilers camlp4-extra opam -y -f | |
mkdir -p /usr/src/unison/ | |
cd /usr/src/unison/ | |
wget https://www.seas.upenn.edu/~bcpierce/unison/download/releases/unison-2.51.2/unison-2.51.2.tar.gz -O unison.tar.gz |
View template.php
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 | |
// Determine appropriate menu to load | |
$context = og_context(); | |
$menu_name = 'main-menu'; | |
if ($context) { | |
$menus = og_menu_get_group_menus([ | |
$context['group_type'] => [$context['gid']], | |
]); | |
$menu = array_shift($menus); |
View Hero not working...
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 | |
/* | |
* @file | |
* Default theme implementation to display text_page nodes. | |
* | |
* @see template_preprocess() | |
* @see template_preprocess_node() | |
* @see template_process() | |
*/ | |
?> |
View hours.php
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("HOURS_LIBRARY", "your-calendar-group-id@group.calendar.google.com"); | |
$path = '/path/to/google-api-php-client'; | |
require_once($path . "/vendor/autoload.php"); | |
function hours_get_data_for($calendar_id, $service, $opt_params) { | |
$events = $service->events->listEvents($calendar_id, $opt_params); | |
$todays_events = array(); |
View gist:b4e049d858339098452c0d453ce0c982
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
The rule I created to make this works is configured as follows: | |
-- Event: After updating an existing user account | |
-- Conditions: User has role(s) | |
-- -- Parameter: User: data selector: [account], Roles: value: story author override {this is a drupal role I created for this purpose}, | |
-- -- -- Match Roles: "if matching against all selected roles, the user must have ALL the roles selected" | |
-- -- -- Negate is not checked | |
-- Elements: | |
-- -- fetch entity by id: | |
-- -- -- Parameter: Entity type: Node, Identifier: 1 | |
-- -- -- Provides variables: Fetched entity (entity_fetched) |
View gist:91f7f91c1890eee1e058dc3e2e278255
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
find . -type f | sed -n 's/..*\.//p' | sort | uniq -c |
View findMixedModeErrors.js
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
jQuery(document).ready(function() { | |
var $srcitems = jQuery("[src^='http://']"); | |
var $hrefitems = jQuery("link[href^='http://']"); | |
var totalitems = $srcitems.length + $hrefitems.length; | |
if (totalitems > 0) { | |
alert('Found ' + totalitems + ' items that will trigger mixed mode. Check the console for these items.'); | |
for (var i = 0, len = $srcitems.length; i < len; i++) { | |
console.log($srcitems[i]); | |
} | |
for (var i = 0, len = $hrefitems.length; i < len; i++) { |
View drupal_diff_module.sh
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 | |
MODULE=$1 | |
VERFROM=$2 | |
VERTO=$3 | |
shift | |
shift | |
shift | |
if [ "$MODULE" == "" ] || [ "$VERFROM" == "" ] || [ "$VERTO" == "" ] |
View drupal_parallel_drush.sh
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 | |
DRUPALPATH=$1 | |
shift | |
if [ "$DRUPALPATH" == "" ] | |
then | |
echo "Usage: $0 drupal-path drush-command with-args?" | |
exit 1 | |
fi |
NewerOlder