Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am decadecity on github.
  • I am decadecity (https://keybase.io/decadecity) on keybase.
  • I have a public key whose fingerprint is 5CA2 0E6F 9F95 D922 2B94 D137 993D FB98 0DE7 E5FA

To claim this, I am signing this object:

import MySQLdb
from pprint import pprint
db = MySQLdb.connect(
host="127.0.0.1",
user="[redacted]",
passwd="[redacted]",
db="httparchive"
)
@decadecity
decadecity / results.json
Created March 28, 2014 17:02
jQuery parse time data
[
{
"jquery":"1.11.0",
"parse_time":23,
"browser":{
"ua":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/33.0.1750.146 Safari\/537.36",
"browser":{
"name":"Chrome",
"version":"33.0.1750.146",
"major":"33"
@decadecity
decadecity / mixins.less
Last active November 15, 2016 19:30
Less mixins
// Helper functions used throughout the code base.
// The old IE versions can cause the browser to hang so commented out.
#gradient {
.linear(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
background-color: @color;
background-image: -webkit-gradient(linear, left top, left top, color-stop(0, @start), color-stop(1, @stop));
background-image: -webkit-linear-gradient(@start, @stop);
background-image: -ms-linear-gradient(top, @start, @stop);
//filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",@start,@stop)); // IE6 & IE7
@decadecity
decadecity / timer.html
Last active December 17, 2015 02:59
Example showing in page timers that can be used as a fall back when the Navigation Timing API is not available.
<!doctype html>
<html>
<head>
<script>window.t_pagestart = new Date().getTime();</script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>In page timer example</title>
</head>
<body>
<h1>Lorem ipsum</h1>
@decadecity
decadecity / cross-check.html
Created November 13, 2012 11:30
Categorizr cross-check data JSONifer
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Categorizr cross-check JSONifer
</head>
<body>
<script src="//cdnjs.cloudflare.com/ajax/libs/zepto/1.0rc1/zepto.min.js "></script>
<script>
// This is VERY rough and ready and incredibly fragile.
@decadecity
decadecity / data_extract.py
Created July 29, 2012 11:46
Data processing script to calculate the relationship between request time and DOM load time.
#!/usr/bin/python
"""
Data processing script to calculate the relationship between request time and
DOM load time.
See: http://blog.decadecity.net/2012/09/15/how-long-does-an-http-request-take/
"""
import apachelog # https://code.google.com/p/apachelog/
import re
import urlparse