Skip to content

Instantly share code, notes, and snippets.

View dpino's full-sized avatar
🏠
Working from home

Diego Pino dpino

🏠
Working from home
View GitHub Profile
#!/usr/bin/env perl
# Reads out a web-platform-test run output and prints out a report were errors
# are grouped by text message and list of files. Reports also on total number
# of distinct errors and total number of failing files.
# Arguments:
# Agent: Actual the head of the string containing the test name. The rest of
# the string should the filename.
# Errorfile: web-platform-test output of a ./wpt run.
@dpino
dpino / wpt-run-report.pl
Last active January 16, 2018 16:02
Parses web-platform-test output and groups results by error message and list of files
#!/usr/bin/env perl
# Reads out a web-platform-test run output and prints out a report were errors
# are grouped by text message and list of files. Reports also on total number
# of distinct errors and total number of failing files.
# Arguments:
# Agent: Actual the head of the string containing the test name. The rest of
# the string should the filename.
# Errorfile: web-platform-test output of a ./wpt run.
@dpino
dpino / snakecoin-server-full-code.py
Last active January 4, 2019 03:19 — forked from aunyks/snakecoin-server-full-code.py
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
#!/usr/bin/env python
# Source https://gist.github.com/aunyks/47d157f8bc7d1829a729c2a6a919c173
# Modifications:
# - Can pass port number as command line argument.
# - Added GET method /add_peer.
# - On retrieving blockchain, call consensus to synchronize with other peers.
# - On updating the current blockchain from a peers' blockchain, convert list
# of JSON blocks to native Block objects.
@dpino
dpino / iframe-as-worker.html
Created October 24, 2017 17:31
Using an iframe as a worker
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<iframe id="w0" src="iframe2.html" style="display: none"></iframe>
$ git log -1
commit 9856da7802247e70ba7410666d0048fc7a1e2f07
Author: Diego Pino Garcia <dpino@igalia.com>
Date: Thu Oct 27 14:48:40 2016 +0000
Add unit test for ipv6_cache_trigger
TEST core.timer
TEST core.counter
TEST core.lib
commit db2e4369522aee5ec2ee2ec8391ac1d0bd7be7d8
Author: Diego Pino Garcia <dpino@igalia.com>
Date: Thu Oct 27 16:15:30 2016 +0200
Rename snabb-lwaftr to snabbvmx in Makefile
DIR obj/testlog
TEST lib.pmu
SKIPPED testlog/lib.pmu
TEST lib.numa
$ git log -1
commit faa32bfcacda682f19bdfabc5721fef3e3972a97
Author: Diego Pino Garcia <dpino@igalia.com>
Date: Thu Oct 27 13:32:26 2016 +0200
Add image
TEST core.timer
TEST core.counter
TEST core.lib
@dpino
dpino / ns-ipv6-no-nat.sh
Created April 29, 2016 22:19
Create Network Namespace with IPv6 connectivity via Hurricane Electric tunnel (no NAT66 needed)
#!/usr/bin/env bash
set -x
if [[ $EUID -ne 0 ]]; then
echo "You must run this script as root."
exit 1
fi
# Fill up IPv6 addresses for the veth pair. Addresses must belong to the
@dpino
dpino / ns-ipv6.sh
Created April 29, 2016 22:16
Create Network Namespace with IPv6 connectivity via Hurricane Electric tunnel
#!/usr/bin/env bash
set -x
if [[ $EUID -ne 0 ]]; then
echo "You must run this script as root."
exit 1
fi
VETH1_IPV6=fd00::1
@dpino
dpino / sof-36834786.lua
Created April 25, 2016 14:50
Print_r in Lua
-- Possible solution to http://stackoverflow.com/questions/36834786/how-to-save-a-table-to-a-file-from-lua/36836187#36836187
function print_r (t, fd)
fd = fd or io.stdout
local function print(str)
str = str or ""
fd:write(str.."\n")
end
local print_r_cache={}
local function sub_print_r(t,indent)