Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| #!/bin/bash | |
| # | |
| # Report time to first byte for the provided URL using a cache buster to ensure | |
| # that we're measuring full cold-cache performance | |
| while (($#)); do | |
| echo $1 | |
| curl -so /dev/null -H "Pragma: no-cache" -H "Cache-Control: no-cache" \ | |
| -w "%{http_code}\tPre-Transfer: %{time_pretransfer}\tStart Transfer: %{time_starttransfer}\tTotal: %{time_total}\tSize: %{size_download}\n" \ | |
| "$1?`date +%s`" |
| /** | |
| * PE to use SVG as CSS background image with fallback for IE8/7/6 | |
| * | |
| * Using SVG as CSS background image to display | |
| * resolution-independent logos or icons is pretty | |
| * awesome but does completely fail on IE8/7/6 | |
| * | |
| * The trick: | |
| * All three IE versions don't support rgba color values. | |
| * By defining a rgba background color together with the |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| /*! | |
| An experiment in getting accurate visible viewport dimensions across devices | |
| (c) 2012 Scott Jehl. | |
| MIT/GPLv2 Licence | |
| */ | |
| function viewportSize(){ | |
| var test = document.createElement( "div" ); | |
| test.style.cssText = "position: fixed;top: 0;left: 0;bottom: 0;right: 0;"; |
| /* ---------------------------------------------------------- */ | |
| /* */ | |
| /* A media query that captures: */ | |
| /* */ | |
| /* - Retina iOS devices */ | |
| /* - Retina Macs running Safari */ | |
| /* - High DPI Windows PCs running IE 8 and above */ | |
| /* - Low DPI Windows PCs running IE, zoomed in */ | |
| /* - Low DPI Windows PCs and Macs running Firefox, zoomed in */ | |
| /* - Android hdpi devices and above */ |
| #!/usr/bin/python | |
| import subprocess | |
| import re | |
| import os | |
| import sys | |
| import optparse | |
| import time | |
| def call_checked(*args): | |
| r = subprocess.call(args) |
| Original file: | |
| Lena.png 512 x 512 Pixel 24 bit Color 386.301 Byte | |
| The standard for image compression tests. | |
| Might be highly optimized in some encoders. | |
| Goal: Get the most quality out of around 56KB. | |
| Look at http://benediktkastl.de/summary_lena.htm for the images. | |
| Metrics explained: |
| function onOpen() { | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| var menuEntries = [ {name: "Run Query", functionName: "runQuery"} ]; | |
| ss.addMenu("HTTP Archive + BigQuery", menuEntries); | |
| } | |
| function runQuery() { | |
| var projectNumber = 'httparchive'; | |
| var sheet = SpreadsheetApp.getActiveSheet(); |
| # -*- 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. |
| #!/bin/sh | |
| # | |
| # Startup script for btsync | |
| # Copy to /usr/local/etc/rc.d/S99btsync.sh and chown to root:root | |
| # | |
| # Stop myself if running | |
| btsyncdir="/var/services/homes/yotam/btsync/" | |
| btsync="${btsyncdir}/btsync" | |
| pidfile="${btsyncdir}/.sync/sync.pid" | |
| # |