Skip to content

Instantly share code, notes, and snippets.

@jklein
jklein / gist:5001670
Last active December 14, 2015 00:49
CSS/HTML for Sunny
<style>
.related_video {
clear:both;
width:100%;
margin-bottom:20px;
}
.related_video img {
float:left;
margin: 0px 5px 5px 5px;
(function(Etsy) {
Etsy.Monitoring = {
page_group: 'browse_subcategory',
BW: { enabled: false }
};
var iframe = document.createElement('iframe');
iframe.src="javascript:false";
(iframe.frameElement || iframe).style.cssText = "width: 0; height: 0; border: 0";
var where = document.getElementsByTagName('script')[0];
Create Table: CREATE TABLE `buda_users_contact_info_bak` (
`object_id` int(11) NOT NULL DEFAULT '0',
`alias` varchar(100) DEFAULT NULL,
`street_address_1` varchar(100) DEFAULT NULL,
`street_address_2` varchar(100) DEFAULT NULL,
`city` varchar(50) DEFAULT NULL,
`zip` varchar(10) DEFAULT NULL,
`state` varchar(50) DEFAULT NULL,
`tel_work` varchar(50) DEFAULT NULL,
`tel_home` varchar(50) DEFAULT NULL,
Create Table: CREATE TABLE `buda_users_public_bak` (
`user_id` int(10) unsigned NOT NULL DEFAULT '0',
`user_name` varchar(100) NOT NULL DEFAULT '',
`email` varchar(100) NOT NULL DEFAULT '',
`password` varchar(16) DEFAULT NULL,
`first_name` varchar(100) NOT NULL DEFAULT '',
`last_name` varchar(100) NOT NULL DEFAULT '',
`edited_date` datetime DEFAULT NULL,
`edited_by` varchar(50) DEFAULT NULL,
`modification_id` varchar(50) DEFAULT NULL,
@jklein
jklein / gist:5426753
Created April 20, 2013 17:32
Export Joomla 1.5 users to XML
<?php
$m = new mysqli('localhost', 'root', '<password>', 'buda_prod');
$result = $m->query('Select * from jos2_users');
while ($row = $result->fetch_assoc()) {
$results[] = $row;
}
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']) ) {
@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
@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 / 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.
<?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);