Skip to content

Instantly share code, notes, and snippets.

@Hexcles
Hexcles / bootstrap.sh
Last active April 30, 2020 21:23
Test dl.google.com
# On the host VM (run as root):
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt-get install -qy docker-ce
systemctl daemon-reload && systemctl start docker.service
docker run -it ubuntu:latest bash
@Hexcles
Hexcles / reopen-wpt-prs.py
Created January 24, 2020 19:56
WPT PR Recovery
#!/usr/bin/env python3
import json
import requests
with open("github-credentials.json", "r") as f:
creds = json.load(f)
prs = open("pr-list", "r")
with open("pr-errors", "w") as err:
@Hexcles
Hexcles / CDP_Command_for_WPT.md
Created September 19, 2019 04:44
Puppeteer/CDP for WPT

Based on @jugglinmike ExecutorCDP prototype

grep 'API status' tools/pyppeteer/ -r | grep -Eo "'[A-Z][A-Za-z]+\.[A-Za-z]+'" | sort | uniq -c | sort -rn
5 'Input.dispatchMouseEvent'
4 'Runtime.releaseObject'
4 'Input.dispatchKeyEvent'
@Hexcles
Hexcles / find_dupes.py
Last active November 14, 2017 21:18
Simple LayoutTests global baseline optimization
from __future__ import print_function
from collections import defaultdict
import hashlib
import re
def main():
baselines = defaultdict(dict)
f = open('baselines', 'r')
regexp_head = re.compile(r'^\./(platform/[^/]+/)')
@Hexcles
Hexcles / wpt-import-stats.py
Created September 25, 2017 23:21
wpt-import-stats.py
#!/usr/bin/python2
# Requirements: numpy & dateutil ( sudo apt install python-{numpy,dateutil} )
from __future__ import print_function
from collections import defaultdict, namedtuple
import dateutil.parser
import json
import re
import numpy
import os
@Hexcles
Hexcles / wpt-export-stats.py
Last active September 25, 2017 23:22
WPT Export Stats
#!/usr/bin/python2
# Based off https://gist.github.com/jeffcarp/f1fb015e38f50e82d30b8c69b67faa74
# Requirements: numpy & requests ( sudo apt install python-{numpy,requests} )
from __future__ import print_function
from datetime import datetime
import csv
import collections
import json
import numpy
@Hexcles
Hexcles / LICENSE
Created July 20, 2017 21:28
[chromium] Convert W3CImportExpectations to OWNERS files
// Copyright 2015 The Chromium Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer

Keybase proof

I hereby claim:

  • I am Hexcles on github.
  • I am hexcles (https://keybase.io/hexcles) on keybase.
  • I have a public key whose fingerprint is D702 16BF 9E85 ACDF 713D 239B 9BB2 B9D1 6044 A8E7

To claim this, I am signing this object:

@Hexcles
Hexcles / .ycm_extra_conf.py
Created May 7, 2015 22:15
YouCompleteMe extra conf for Linux kernel
# .ycm_extra_conf.py for kernel
import os
# Attention:
# File path not starting with / or = will be expanded.
flags_c = [
'-Wall',
'-Wundef',
'-Wstrict-prototypes',
@Hexcles
Hexcles / urldecode.py
Last active August 29, 2015 14:10
Rename urlencoded (quoted) filenames
#!/usr/bin/env python3
from sys import argv
from os import path, system
from urllib.parse import unquote
if len(argv) == 1:
print("Usage: urldecode.py FILES...")
exit