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
@dpino
dpino / gist:e7892470bd5dda746fa612ff007cd496
Created March 21, 2024 20:14
current_branch_equals_remote.sh
#!/usr/bin/env bash
REPO=git@github.com:microsoft/playwright.git
BRANCH=release-1.41
current_branch_equals_remote() {
git branch -vv
local current_branch=$(git rev-parse --abbrev-ref HEAD)
if [[ $(git log -1 --pretty="%h" ${current_branch}) == $(git log -1 --pretty="%h" origin/${current_branch}) ]]; then
echo "Current branch equals remote branch"
@dpino
dpino / last-successful-build-to-git-commit.sh
Last active November 16, 2022 12:40
Fetch commit of last successful WebKit build (default: GTK-Linux-64-bit-Release-Ubuntu-LTS-Build)
#!/usr/bin/env bash
# set -x
# Return commit of last successful WebKit build (default: GTK-Linux-64-bit-Release-Ubuntu-LTS-Build).
# Changes:
# 2022-11-16: Reworked script using changes suggested by asutherland to fetch commit number of last successful build directly from build.webkit.org.
BUILDER_NAME=${1:-GTK-Linux-64-bit-Release-Ubuntu-LTS-Build}
@dpino
dpino / patch.diff
Created November 24, 2021 14:41
Patch build fixes
From 0f93b285725b0ac8a77a75de0a9d7d0ded94074b Mon Sep 17 00:00:00 2001
From: Diego Pino Garcia <dpino@igalia.com>
Date: Wed, 24 Nov 2021 14:38:36 +0000
Subject: [PATCH] Patch build fixes
---
.../loader/archive/mhtml/MHTMLParser.cpp | 2 +-
.../platform/SharedBufferChunkReader.h | 2 ++
Source/WebCore/platform/gtk/SelectionData.h | 6 ++--
.../ServiceWorkerSoftUpdateLoader.cpp | 2 +-
$ WEBKIT_JHBUILD=1 WEBKIT_JHBUILD_MODULESET=minimal Tools/Scripts/build-webkit --gtk --touch-events --no-bubblewrap-sandbox --cmakeargs=-DUSE_SOUP2=ON --cmakeargs=-DUSE_JPEGXL=OFF --cmakeargs=-DUSE_AVIF=OFF --no-webxr MiniBrowser | tee log
+ /home/dpino/playwright/browser_patches/webkit/checkout/Tools/jhbuild/jhbuild-wrapper --gtk run cmake --build /home/dpino/playwright/browser_patches/webkit/checkout/WebKitBuild/Release --config Release --
[0/548] Generate bindings (WebCoreBindings)
Preprocess IDL
[4/548] cd /home/dpino/playwright/browser_patches/webkit/checkout/WebKitBuild/Release/Source/WebKit && /usr/bin/perl /home/dpino/playwright/browser_patches/webkit/checkout/Source/WebKit/Scripts/generate-forwarding-headers.pl --include-path /home/dpino/playwright/browser_patches/webkit/checkout/Source/WebKit --output /home/dpino/playwright/browser_patches/webkit/checkout/WebKitBuild/Release/DerivedSources/ForwardingHeaders --platform gtk --platform soup
[5/124] Generate bindings (TestRunnerSharedBindings)
[6/124]
@dpino
dpino / main.cc
Last active November 15, 2022 11:14
Pass CPP object to JavaScript function
/**
* Pass CPP object to JavaScript function
*
* sample.js:
* function fileInfo(obj)
* {
* return "fileInfo: " + obj.i;
* }
*
* To compile: g++ main.cc -o main `pkg-config --cflags --libs javascriptcoregtk-4.0`
@dpino
dpino / layout-tests-split
Created March 14, 2019 17:51
Split LayoutTests in several jobs
#!/usr/bin/env bash
function usage {
echo "Usage: layout-tests-split [jobs] [webkit-dir]"
}
JOBS="${1:-1}"
WEBKIT_DIR="${2:-.}"
LAYOUT_TESTS_DIR="$WEBKIT_DIR/LayoutTests/"
@dpino
dpino / build_bots_status.py
Created March 12, 2019 14:10
WPE & GTK WebKit build bots status
#!/usr/bin/env python
import urllib
import json
from urllib2 import urlopen
bots_names = [
"WPE Linux 64-bit Release (Build)",
"WPE Linux 64-bit Debug (Build)",
@dpino
dpino / modulo.lua
Created January 4, 2019 12:09
Microbenchmark for LuaJIT's modulo operations
local C = ffi.C
function fold(fn, times)
local now = os.clock()
for i=1,times do
fn()
end
return os.clock() - now
end
@dpino
dpino / b4-to-aftr-over-inet.sh
Created February 8, 2018 17:32
Communication of a lwB4 network fuction with a remote lwAFTR over Internet
#/usr/bin/env bash
set -x
# This script implements a lwB4 network function insolated into its own network namespace. Once running any IPv4 network command
# will get forwarded to a remote lwAFTR over the Internet. Communication with the lwAFTR is meant to happen via an IPv6 tunnel
# broker (such as Hurricane Electric) which should be already up and running.
# Author: Diego Pino Garca <dpino@igalia.com>
# Based on https://marcelwiget.wordpress.com/2015/11/30/lightweight-4over6-b4-client-in-linux-namespace/
@dpino
dpino / run-all.sh
Last active January 28, 2018 18:36
#!/usr/bin/env bash
FOLDERS=(
built-ins
annexB
intl402
language
)
for each in ${FOLDERS[@]}; do