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
function git { | |
test -z $GITCOMMAND && GITCOMMAND=`which git` | |
if [ "$1" == "git" ] | |
then | |
git $2 | |
else | |
$GITCOMMAND $1 | |
fi | |
} |
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
def bsearch_index(ary) | |
low = 0 | |
high = ary.length | |
smaller = 0 | |
satisfied = 0 | |
while low < high | |
mid = low + ((high - low) / 2) | |
val = ary[mid] | |
begin |
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
#!/usr/bin/env php | |
<?php | |
$file_contents = file_get_contents("php://stdin"); | |
$data = unserialize($file_contents); | |
$results = []; | |
foreach ($data as $key => $values) { | |
list($caller, $callee) = explode('==>', $key); |
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
#!/usr/bin/env php | |
<?php | |
$whitelist = [ | |
"main()", | |
"MemcachePool::get", | |
"PDOStatement::execute", | |
"PDO::commit", | |
"DatabaseStatementBase::execute", | |
"InsertQuery_mysql::execute", |
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
#!/usr/bin/env ruby | |
require "optparse" | |
DEFAULT_QUANTILES = [0.25, 0.50, 0.75, 0.90, 0.95, 0.99, 0.999] | |
def quantile(values, p, presorted = false) | |
return values.first if values.size == 1 | |
values = values.sort unless presorted | |
hh = (values.size - 1) * p + 1 | |
h = hh.floor |
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
if (!"ggplot2" %in% rownames(installed.packages())) { | |
install.packages("ggplot2") | |
} | |
library("ggplot2") | |
args <- commandArgs(trailingOnly = TRUE) | |
before_file <- args[1] | |
after_file <- args[2] |
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
library("rvest") | |
library("dplyr") | |
ec2_df <- html("http://www.ec2instances.info") %>% | |
html_nodes("table") %>% | |
first %>% | |
html_table() | |
str(ec2_df) |
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
135 FieldCollectionItemEntity::hostEntity | |
-> 67 entity_revision_load | |
-> 67 PanelsPaneController::load | |
-> 67 EntityCacheControllerHelper::entityCacheLoad | |
-> 67 PanelsPaneController::attachLoad | |
-> 67 DrupalDefaultEntityController::attachLoad | |
-> panelizer_entity_load 362ms | |
-> PanelizerEntityDefault::has_default_panel | |
-> 1 PanelizerEntityDefault::default_display_exists 303ms | |
-> 1 ctools_export_load_object |
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/puppet/versions/devel/modules/xhprof/files/acquia_xhprof/acquia_xhprof.php b/puppet/versions/devel/modules/xhprof/files/acquia_xhprof/acquia_xhprof.php | |
index 5cfa756..1bcf4e3 100644 | |
--- a/puppet/versions/devel/modules/xhprof/files/acquia_xhprof/acquia_xhprof.php | |
+++ b/puppet/versions/devel/modules/xhprof/files/acquia_xhprof/acquia_xhprof.php | |
@@ -38,8 +38,11 @@ function acquia_hosting_xhprof_enabled() { | |
// Can't use ini_get here since it's a custom variable. | |
$xhprof_enabled = get_cfg_var('acquia.xhprof_enabled'); | |
- $ret = FALSE; | |
if ($xhprof_enabled) { |
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
#!/usr/bin/env php | |
<?php | |
function xhprof_raw_format_to_call_records($run_id, $raw_xhprof, $whitelist, $params = array()) { | |
$calls = array(); | |
foreach ($raw_xhprof as $key => $values) { | |
if ($key === 'main()') { | |
$caller = ""; | |
$callee = "main()"; | |
} |