Skip to content

Instantly share code, notes, and snippets.

View neclimdul's full-sized avatar

James Gilliland neclimdul

View GitHub Profile
<?php
function method($cache) {
$prepared = clone $cache;
$prepared->data = unserialize($prepared->data);
return $prepared;
}
$cache = new stdClass();
$cache->data = serialize(['foo' => 'bar']);
There was 1 failure:
1) Drupal\Tests\Core\Entity\EntityUnitTest::testCacheTags
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
- 0 => 'additional_cache_tag'
- 1 => 'aYjF6vMj:1'
<?php
$path = 'd';
echo "RouteProvider::getRoutesByPath():\n";
bench('d');
bench('d/d');
bench('d/d/d');
bench('d//d///d');
bench('/d/d/d/d////d/d/d/d/d/d/d/d/d/d/d/d/d/d/d/d/d/d');
@neclimdul
neclimdul / server_admin.sh
Created July 4, 2015 19:46
Minecraft server admin script.
#!/bin/bash
## Name of the script used to start the server.
# This will be written by this script in the directory you run it in.
# Avoid ServerStart.sh because this will collide with FTB Server scripts.
CONTROL_SCRIPT="ServerAdminStart.sh"
## Memory options
# -Xms controls initial memory.
# -Xmx controls maximum memory threshold.
diff --git a/core/modules/migrate_drupal/src/Tests/Table/d6/Access.php b/core/modules/migrate_drupal/src/Tests/Table/d6/Access.php
index 5339530..d92a2f5 100644
--- a/core/modules/migrate_drupal/src/Tests/Table/d6/Access.php
+++ b/core/modules/migrate_drupal/src/Tests/Table/d6/Access.php
@@ -3,11 +3,6 @@
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Table\d6\Access.
- *
- * THIS IS A GENERATED FILE. DO NOT EDIT.
@neclimdul
neclimdul / core_tests.sh
Created May 11, 2015 20:40
core_tests.sh
#!/bin/bash
WEB=`pgrep nginx | wc -l`
if [ $WEB -eq 0 ]; then
WEB=`pgrep apache | wc -l`
if [ $WEB -eq 0 ]; then
echo "start your damn web server"
exit
fi
fi
@neclimdul
neclimdul / engineException.php
Created March 31, 2015 21:26
Trigger a fatal trying to handle a engine exception in php7
<?php
set_exception_handler('_default_exception_handler');
function _default_exception_handler(\Exception $e) {
}
foobar();
<?php
class something {
protected $results;
public function render() {
$results = $this->getResults();
}
@neclimdul
neclimdul / conneg-test-cases.md
Created March 5, 2015 17:45
conneg test cases
  • rss.xml - single purpose path responding with a content type
  • node/1.json - multipurpose path with an extension denoting content type.
  • myalias.json - an alias with and extension.
  • rest/node/1 - a non-web endpoint doing full conneg
phpinfo()
PHP Version => 5.6.6-1+deb.sury.org~utopic+1
System => Linux e6420w7-07 3.16.0-31-generic #41-Ubuntu SMP Tue Feb 10 15:24:04 UTC 2015 x86_64
Build Date => Feb 20 2015 11:21:56
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
Scan this dir for additional .ini files => /etc/php5/cli/conf.d