Skip to content

Instantly share code, notes, and snippets.

@irori
irori / devtools-unbundled.json
Created March 2, 2020 05:20
DevTools WBN load timelines
This file has been truncated, but you can view the full file.
[{"args":{"name":"CrGpuMain"},"cat":"__metadata","name":"thread_name","ph":"M","pid":221287,"tid":221287,"ts":0},
{"args":{"name":"CrBrowserMain"},"cat":"__metadata","name":"thread_name","ph":"M","pid":221257,"tid":221257,"ts":0},
{"args":{"name":"CrRendererMain"},"cat":"__metadata","name":"thread_name","ph":"M","pid":221409,"tid":1,"ts":0},
{"args":{"name":"Chrome_IOThread"},"cat":"__metadata","name":"thread_name","ph":"M","pid":221257,"tid":221269,"ts":0},
{"args":{"name":"VizCompositorThread"},"cat":"__metadata","name":"thread_name","ph":"M","pid":221287,"tid":221337,"ts":0},
{"args":{"name":"Chrome_ChildIOThread"},"cat":"__metadata","name":"thread_name","ph":"M","pid":221409,"tid":4,"ts":0},
{"args":{"name":"BrowserWatchdog"},"cat":"__metadata","name":"thread_name","ph":"M","pid":221257,"tid":221282,"ts":0},
{"args":{"name":"CompositorTileWorker1"},"cat":"__metadata","name":"thread_name","ph":"M","pid":221257,"tid":221280,"ts":0},
{"args":{"name":"Compositor"},"cat":"__metadata","name":"thread_name","ph":
import random
import defcon
from ufo2ft import compileOTF
def random_moves(c, n):
for i in range(n):
x = random.randint(0, 1024)
y = random.randint(0, 1024)
@irori
irori / sctlist.rb
Created April 11, 2018 04:03
SignedCertificateTimestampList generator
#!/usr/bin/ruby
# Combines SCTs into a SignedCertificateTimestampList structure.
# usage: sctlist.rb a.sct b.sct ...
buf = ""
ARGV.each do |f|
sct = File.read(f, :encoding => Encoding::ASCII_8BIT)
buf += [sct.bytesize].pack('n') + sct
end
@irori
irori / FetchDescendants.svg
Last active January 18, 2018 05:07
pprof results of module loading
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/ruby
#
# Calculate "Time to First Meaningful Paint" from trace events
# usage: ttfmp.rb trace.json
require 'json'
class TraceAnalyzer
def initialize(trace)
@json = JSON.parse(IO.read(trace))
@irori
irori / lifter.cc
Created July 17, 2012 13:06
irori @ ICFP Programming Contest 2012
#include <algorithm>
#include <fstream>
#include <iostream>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>
#include <signal.h>
#include <stdio.h>
#include <string.h>