Skip to content

Instantly share code, notes, and snippets.

<?php echo $this->_tpl_vars['test_variable']; ?>
<br/>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'some_assigns_happen_here.tpl', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
?>
<?php echo $this->_tpl_vars['test_variable']; ?>
I've been doing a bunch of auditing of the homepage (both signed in and signed out), and my latest discovery involves this unexpectedly expensive query:
select Taxonomy.taxonomy_id as Taxonomy__taxonomy_id,
Taxonomy.top_level_id as Taxonomy__top_level_id,
Taxonomy.name as Taxonomy__name,
Taxonomy.metadata as Taxonomy__metadata,
Taxonomy.shard_id as Taxonomy__shard_id,
Taxonomy.old_shard as Taxonomy__old_shard,
Taxonomy.migration_lock as Taxonomy__migration_lock,
Taxonomy.create_date as Taxonomy__create_date,
@jklein
jklein / xhgui_VagrantFile.rb
Last active July 20, 2016 13:01
XHGui VagrantFile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
diff --git a/index.html b/index.html
index 4e0df7e..a1bc733 100644
--- a/index.html
+++ b/index.html
@@ -84,10 +84,10 @@
&nbsp;
</div>
- <a href="https://github.com/etsy/ab">
+ <a href="https://github.com/etsy/feature">
[templates (master)↑⚡]> templatetrace pages/your_etsy/shop/registration/_modules/header_steps.tpl
pages/your_etsy/shop/registration/_modules/header_steps.tpl
pages/your_etsy/shop/registration/_modules/header.tpl
pages/storefronts/seller_payment_account/onboarding.tpl
pages/shop2/index.tpl
pages/listings/view.tpl
pages/storefronts/orders/transaction.tpl
pages/your_etsy/edit_profile.tpl
pages/your_etsy/base.tpl
pages/storefronts/orders/dead_receipt.tpl
<?php
// Date format: YYYY/MM/DD
function getVimeoData($start_date, $end_date) {
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "https://vimeo.com/stats?action=totals&start_date=" . urlencode($start_date) . "&end_date=" . urlencode($end_date) . "&update_chart=false");
curl_setopt($ch, CURLOPT_HEADER, 0);
@jklein
jklein / Vagrantfile
Last active September 19, 2018 10:18
Vagrant file for a private WebPagetest instance
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@jklein
jklein / mysqltuner.txt
Created August 25, 2013 16:39
Ruglots MySQLTuner Results
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.30-30.1
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 191M (Tables: 33)
[--] Data in InnoDB tables: 3G (Tables: 964)
[--] Data in MEMORY tables: 7M (Tables: 34)
@jklein
jklein / gist:6135730
Created August 1, 2013 21:55
ApacheBench before tuning, after adding swap
~/development/sshmount$ab -n 1000 -c 50 http://buda.org/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking buda.org (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Index: webpagetest/runtest.php
===================================================================
--- webpagetest/runtest.php (revision 1932)
+++ webpagetest/runtest.php (working copy)
@@ -917,9 +917,13 @@
else
{
// see if we need to pick the default connectivity
- if( (!isset($locations[$test['location']]['connectivity']) || !strlen($locations[$test['location']]['connectivity'])) && !isset($test['connectivity']) )
+ if( (!isset($locations[$test['location']]['connectivity']) || !strlen($locations[$test['location']]['connectivity'])) && !isset($test['connectivity']) ) {