Skip to content

Instantly share code, notes, and snippets.

View omo's full-sized avatar

Hajime Morrita omo

  • Mountain View, CA
View GitHub Profile
@omo
omo / README.md
Last active March 14, 2024 15:56
XPS 17 9730 touchpad problem workaround on Ubuntu 22.04

XPS 17 9730 touchpad problem workaround on Ubuntu 22.04

This is a follow up for my Reddit post. Note that this is relevant for the classic X server (not Xwayland, which doesn't have this problem). If you have an NVIDIA GPU on your laptop, This is probably for you: Ubuntu configures the system with the non-Wayland, classic X server when an NVIDIA GPU is used.

The inspiration is from this article from the DELL site. Although the approach is outdated for recent Ubuntu, the basic premise is the same, that is, to eliminate duplicated touchpad / mouse input from X server configuration.

@omo
omo / Dockerfile
Created February 1, 2021 05:26
oauth2-proxy on Cloud Run
FROM alpine:3.13
WORKDIR /opt/draft-proxy
RUN apk update && apk add git curl
RUN curl -L -o package.tgz https://github.com/oauth2-proxy/oauth2-proxy/releases/download/v6.1.1/oauth2-proxy-v6.1.1.linux-amd64.tar.gz && \
tar xvzf package.tgz && \
mv oauth2-proxy-*.linux-amd64/oauth2-proxy .
CMD ["./oauth2-proxy", \
"--provider=github", "--github-org=YOUR_GITHUB_ORG", "--email-domain=*", \
"--http-address=0.0.0.0:8080", \
"--reverse-proxy=true", \
append 48360
add 11626
put 10803
decode 10319
write 7416
get 6568
access 6497
create 6418
read 6093
value 4416
@omo
omo / README.md
Created August 1, 2020 03:50
V2S Privacy Policy

We don't any PII but who cares anyway?

const int large_size = 32*1024*1024;
const volatile int large[large_size] = {};
int main() {
for (int i = 0; i < large_size; i++) {
volatile int li = large[i];
}
return 0;
}
@omo
omo / gist:9986103
Created April 5, 2014 01:08
HTML Imports: Discussion over Async/Progressive Loading

HTML Imports: Discussion over Async/Progressive Loading

There are concerns around HTML Imports that does sync or blocking loading as the default. I’d like to address these concerns. Especially I’d like to understand the actual use cases that “sync” loading hurts. This document aims to be a portal of that effort.

What to Block

Before discussing use cases, let’s clarify which part of page loading process HTML Imports possibly blocks. The blocking model of HTML Imports is modeled after the one for external stylesheets. There are two main bits of the blocking:

The <script> elements

<!DOCTYPE>
<script>
window.Document.prototype.hello = function() {
alert("Hello!");
}
</script>
<h1>Call document.hello() for me.</h1>
# -*- coding: utf-8 -*-
import os
import json
import urllib
import urllib2
import requests
URL = "https://api.github.com/gists"
#PADDING_SIZE = 1024 # This works
@omo
omo / profilers.html
Created July 16, 2013 03:14
This demonstrates how to use window.internals.profilers API.
<!HTML>
<html>
<head></head>
<body>
<script>
function parseProfileHeader(text)
{
return parseInt(text.match(/(\d+) \[/)[1]);
}
@omo
omo / gist:5553547
Last active December 17, 2015 04:49
#0 0x0000555559529d6c in WebCore::wrap (impl=0x2ebf9c071620, creationContext=..., isolate=0x7ffff7e62020) at gen/webkit/bindings/V8DocumentFragment.h:72
#1 0x0000555559a8fdac in WebCore::wrap (impl=0x2ebf9c071620, creationContext=..., isolate=0x7ffff7e62020) at ../../third_party/WebKit/Source/bindings/v8/custom/V8NodeCustom.cpp:152
#2 0x00005555594cde8f in WebCore::toV8 (impl=0x2ebf9c071620, creationContext=..., isolate=0x7ffff7e62020) at gen/webkit/bindings/V8Node.h:75
#3 0x0000555559a706a1 in WebCore::toV8 (impl=0x2ebf9c071620, creationContext=..., isolate=0x7ffff7e62020) at ../../third_party/WebKit/Source/bindings/v8/custom/V8EventTargetCustom.cpp:50
#4 0x0000555559b220bc in WebCore::V8AbstractEventListener::getReceiverObject (this=0x2ebf9b177f50, context=0x2ebf9b3390c8, event=0x2ebf9ba3ed60) at ../../third_party/WebKit/Source/bindings/v8/V8AbstractEventListener.cpp:186
#5 0x0000555559b23262 in WebCore::V8EventListener::callListenerFunction (this=0x2ebf9b177f50, context=0x2ebf9b3390c8, jsEvent=..., e