Skip to content

Instantly share code, notes, and snippets.

@letharion
letharion / health.md
Last active February 15, 2020 11:14
Health
@letharion
letharion / keybase.md
Created October 8, 2016 12:39
Keybase proof

Keybase proof

I hereby claim:

  • I am letharion on github.
  • I am letharion (https://keybase.io/letharion) on keybase.
  • I have a public key ASAq7Hj_D9eor4ANXalkR-eOtEiGx-mh82fyrHO9Znz8kAo

To claim this, I am signing this object:

@letharion
letharion / Rimworld launcher
Last active August 29, 2015 13:57
Rimworld launcher
#!/bin/sh
# Launcher for the Linux version of RimWorld
set -o nounset
set -o errexit
cd `dirname $0`
main() {
# Defaults
@letharion
letharion / Self reporting assertions
Created March 11, 2014 23:20
Testing assertions
<?php
interface assertReporterInterface {
public function locateIssue($file, $line, $expression, $message);
public function updateIssue($file, $line, $expression, $message);
public function createIssue($file, $line, $expression, $message);
public function assert($file, $line, $expression, $message);
}
class GithubAssertReporter implements assertReporterInterface {
@letharion
letharion / gist:6811658
Created October 3, 2013 15:23
hhvm vhost test
VirtualHost {
* {
Pattern = .*
RewriteRules {
* {
pattern = ^/(.*)/$
to = index.php/$1
qsa = true
}
}
@letharion
letharion / list_hook_menus.php
Created September 1, 2013 14:59
Captures all information in all hook_menues. Counts the number of keys. Repeat after hook alter.
<?php
// Ensure all modules are on so that all hook_menues can be called.
$all_modules = _system_rebuild_module_data();
Drupal::moduleHandler()->enable($all_modules);
// Copied directly from menu.inc. Since menu.inc doesn't use invoke all,
// neither do I.
$callbacks = array();
725 $conf['system.file']['path.public'] = $this->public_files_directory;
726 debug($conf['system.file']);
=>
array (
'path.public' => 'sites/default/files/simpletest/821141',
)
Debug WebTestBase.php 726 Drupal\simpletest\WebTestBase->setUp()
26 $path = config('system.file')->get('path.public');
@letharion
letharion / gist:4150332
Created November 26, 2012 20:14
CMI conversion
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
index 60a9a77..632142f 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
@@ -646,7 +646,7 @@ public function run(array $methods = array()) {
if ($simpletest_config->get('verbose')) {
// Initialize verbose debugging.
$this->verbose = TRUE;
- $this->verboseDirectory = variable_get('file_public_path', conf_path() . '/files') . '/simpletest/verbose';
+ $this->verboseDirectory = config('system.file')->get('path.public') . '/simpletest/verbose';
$ php php_to_string.php
Contains B
PHP Catchable fatal error: Object of class B could not be converted to string in /home/letharion/php_to_string/php_to_string.php on line 22
Catchable fatal error: Object of class B could not be converted to string in /home/letharion/php_to_string/php_to_string.php on line 22
$ cat php_to_string.php
[ 45090.854]
X.Org X Server 1.11.2
Release Date: 2011-11-04
[ 45090.854] X Protocol Version 11, Revision 0
[ 45090.854] Build Operating System: Linux 3.2.1-gentoo-r2 x86_64 Gentoo
[ 45090.854] Current Operating System: Linux Yuna 3.2.12-gentoo #8 SMP PREEMPT Fri May 11 13:26:13 CEST 2012 x86_64
[ 45090.854] Kernel command line: BOOT_IMAGE=/vmlinuz-3.2.12-gentoo_nouveau root=/dev/sda3 ro init=/usr/bin/systemd pcie_aspm=force fastboot
[ 45090.854] Build Date: 11 February 2012 01:24:17PM
[ 45090.854]
[ 45090.854] Current version of pixman: 0.24.0