Skip to content

Instantly share code, notes, and snippets.

View mattleff's full-sized avatar
🌏

Matthew Leffler mattleff

🌏
  • Eureka, MT
View GitHub Profile
<?php
class SF_mapMethod_mock extends DateTime
{
public function __toString()
{
return $this->format('Y-m-d H:i:s');
}
}
<?php
class DB_unit_test_comments extends DB_unit_case_freshdb
{
function testGetNewConfig()
{
$siteinfo = new DB_siteinfo();
$siteinfo->save();
@mattleff
mattleff / gist:1093785
Created July 19, 2011 21:36
The Cardinal Sins of SU Bug Reporting

7 Mortal Sins

  1. Multiple issues in the same ticket
  2. Insufficient vetting of ticket
  • Is duplicable is not a yes/no but a prerequisite(?)
  • What exactly do you have to do to reproduce the issue?
  1. Incorrect/non-descriptive names
  • "no creation date"
  • "Shopping cart (transaction.php) is not charging the correct amount in FF 5.0 and IE 8.0+"
  • No need to mention the browsers unless it is a unique issue with a particular browser, which you should check
<?php
include( 'includes/db_connect.inc.php' );
$link_id = db_connect();
....
//All their code below can use mysql_query() as expected.
$result = mysql_query( $query );
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en_US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">var less = { "env": "development" };</script> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta http-equiv="x-ua-compatible" content="IE=8"/>
<meta name="Description" content="asdfasdf"/>
<base href="http://su.localhost/"/> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/cupertino/jquery-ui.css" type="text/css" media="print, projection, screen"><link rel="stylesheet" href="css/jquery-ui-1.7.2.patch.css" type="text/css" media="print, projection, screen"><link rel="stylesheet" href="css/su_admin.css?version=2011-08-04" type="text/css"><link rel="stylesheet" type="text/css" href="globalcss.php"><script type="text/javascript">
var STATIC_HOST = "";
var STATIC_HOST_IMAGES = "";
@mattleff
mattleff / 504.html
Created October 2, 2012 20:50
504.html
<!DOCTYPE html>
<html>
<head>
<title>504 Network Issue</title>
<meta http-equiv="refresh" content="30;url=/" />
<link rel="shortcut icon" href="http://simpleupdates.s3.amazonaws.com/favicon-su.ico" type="image/x-icon">
<meta name="robots" content="noindex">
<style type="text/css">
body {
@mattleff
mattleff / 502.html
Created October 2, 2012 20:51
502.html
<!DOCTYPE html>
<html>
<head>
<title>502 Bad Gateway</title>
<meta http-equiv="refresh" content="30;url=/" />
<link rel="shortcut icon" href="http://simpleupdates.s3.amazonaws.com/favicon-su.ico" type="image/x-icon">
<meta name="robots" content="noindex">
<style type="text/css">
body {
@mattleff
mattleff / 503.html
Created October 2, 2012 20:56
503.html
<!DOCTYPE html>
<html>
<head>
<title>503 Service Unavailable</title>
<link rel="shortcut icon" href="http://simpleupdates.s3.amazonaws.com/favicon-su.ico" type="image/x-icon">
<meta name="robots" content="noindex">
<style type="text/css">
body {
width: 100%;
@mattleff
mattleff / gist:3933777
Created October 22, 2012 20:07
AWS down
<!DOCTYPE html>
<html>
<head>
<title>503 Service Unavailable</title>
<link rel="shortcut icon" href="http://simpleupdates.s3.amazonaws.com/favicon-su.ico" type="image/x-icon">
<meta name="robots" content="noindex">
<style type="text/css">
body {
[PHP]
engine = On
short_open_tag = On
asp_tags = Off
precision = 12
y2k_compliance = On
output_buffering = Off
zlib.output_compression = Off
zlib.output_handler = On
zlib.output_compression_level = -1