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
# props.conf is at /opt/splunk/etc/system/local/props.conf in debian/ubuntu | |
# | |
# Example log entry: | |
#[Wed Nov 06 17:10:30.436963 2013] [:error] [pid 1238] [client 127.0.0.1:51876] PHP Notice: this is a test warning 22 in /var/www/warning.php on line 2 | |
#[Wed Nov 06 17:10:30.437020 2013] [:error] [pid 1238] [client 127.0.0.1:51876] PHP Stack trace: | |
#[Wed Nov 06 17:10:30.437037 2013] [:error] [pid 1238] [client 127.0.0.1:51876] PHP 1. {main}() /var/www/warning.php:0 | |
#[Wed Nov 06 17:10:30.437050 2013] [:error] [pid 1238] [client 127.0.0.1:51876] PHP 2. trigger_error() /var/www/warning.php:2 | |
# | |
# This will prevent Splunk from breaking PHP stack traces into multiple events: | |
SHOULD_LINEMERGE = false |
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 | |
/** | |
* Inside doctrine locate the executeQuery() method inside the \Doctrine\DBAL\Connection class. | |
* ADD THE FOLLOWING TO THE BEGINNING OF THE executeQuery() METHOD: | |
*/ | |
/** | |
* ADDED TO PROFILE QUERIES | |
*/ | |
if (!isset($GLOBALS['queryCount'])) { |
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
#There are many other ways to do this but i've found using these commands work best and are the least error prone | |
### How to pull down ### | |
git fetch origin master; git merge origin/master | |
#If there is an error here, fix it with: | |
#Open all conflict files, fix them, save them (you could use a diff tool here) | |
git add .; git commit -m "Merged change" | |
git fetch origin master; git merge origin/master |
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 | |
namespace App\Controller; | |
use Psr\Http\Message\ResponseInterface as Response; | |
use Psr\Http\Message\ServerRequestInterface as Request; | |
use Zend\Stratigility\MiddlewareInterface; | |
/** | |
* Class HttpBasicAuth |
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
@PART[*]:HAS[@MODULE[ModuleCommand],!MODULE[MechJebCore]]:Final | |
{ | |
MODULE | |
{ | |
name = ModuleSAS | |
SASServiceLevel = 3 | |
} | |
} |
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
// Returns black or white foreground color depending on the background | |
var textColor = function (backgroundColor) { | |
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(backgroundColor); | |
if (!result) { | |
return '#000000';//Happens when not given hex | |
} | |
var shade = (parseInt(result[1], 16) + parseInt(result[2], 16) + parseInt(result[3], 16)) / 3; | |
return shade > 128 ? '#000000' : '#FFFFFF'; | |
} |
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
var exec = require('child_process').exec; | |
var cmd = process.argv[2]; | |
console.log(' - - - '); | |
console.log('Running the following command repeatedly:'); | |
console.log(cmd); | |
var count = 0; | |
var averageSumTime = 0; | |
var averageTime = 0; |
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
/** | |
* Paste this code at the top of \Doctrine\DBAL\Connection:executeQuery() | |
*/ | |
$startTime = microtime(true); | |
//Body of \Doctrine\DBAL\Connection:executeQuery() goes here |
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
<html> | |
<head> | |
<!-- @TODO uso more official polymer urls than cdn.rawgit.com/download--> | |
<script src="https://cdn.rawgit.com/download/polymer-cdn/1.5.0/lib/webcomponentsjs/webcomponents-lite.min.js"></script> | |
<link rel="import" href="https://cdn.rawgit.com/download/polymer-cdn/1.5.0/lib/iron-ajax/iron-ajax.html"> | |
<style> | |
h1 { | |
text-align: center; | |
font-size: 50px; |
OlderNewer