Skip to content

Instantly share code, notes, and snippets.

View igrigorik's full-sized avatar
:octocat:

Ilya Grigorik igrigorik

:octocat:
View GitHub Profile
@igrigorik
igrigorik / drive-appscript.js
Last active September 30, 2021 13:58
Sample BigQuery queries for the HTTP Archive dataset.
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();
@igrigorik
igrigorik / index.html
Created June 8, 2013 22:36
XHR streaming example
<p>Hello
<script>
var xhr = new XMLHttpRequest();
xhr.open('GET', '/stream');
xhr.seenBytes = 0;
xhr.onreadystatechange = function() {
console.log("state change.. state: "+ xhr.readyState);
@igrigorik
igrigorik / ivideo.sh
Created May 19, 2013 22:58
Convert video to iPod friendly format, and speed up playback.
#! /bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
outformat=mp4
indir=$1
cd "$indir"
<!DOCTYPE html>
<html>
<body>
<h3>Hello SSE!</h3>
<script>
var source = new EventSource('/events');
// new connection opened callback
source.addEventListener('open', function(e) {
console.log('connection opened');
@igrigorik
igrigorik / adb_trace.py
Last active October 11, 2022 10:19
ADB script for remote chrome://tracing debugging!
#!/usr/bin/python
import subprocess
import re
import os
import sys
import optparse
import time
def call_checked(*args):
r = subprocess.call(args)
@igrigorik
igrigorik / bigquery.sql
Created January 3, 2013 04:00
Language popularity on GitHub by number of unique committers...
SELECT repository_language, count(DISTINCT actor) as committers FROM [github.timeline]
GROUP BY repository_language
ORDER BY committers desc
@igrigorik
igrigorik / README.md
Last active December 10, 2015 02:48
Home router latency (Linksys E1550) - quick test.

Quick, take a guess, what's the first hop latency to your home wireless router?

Below 1ms, right? Yeah, you wish!

Below are results from a quick test on my home router (Linksys E1550). Some lessons learned:

  • 3-8ms median
  • very different latency tails on different channels (1,6,11)
  • running in mixed mode helps tame the long tails (do it, if you can)
  • all tests on 2.4Ghz, unfortunately E1550 can't do 5Ghz
@igrigorik
igrigorik / latency.png
Created December 10, 2012 07:18
router latency
latency.png
@igrigorik
igrigorik / links.md
Created August 28, 2012 16:53
HAR Show links & resources
@igrigorik
igrigorik / igvita.har.json
Created August 28, 2012 05:16
Sample HAR capture of igvita.com homepage
{
"log": {
"version": "1.2",
"creator": {
"name": "WebInspector",
"version": "537.1"
},
"pages": [
{
"startedDateTime": "2012-08-28T05:14:24.803Z",