Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<iframe width="400" height="500" src="https://mozilla.pettay.fi/cgi-bin/slowresponse2.pl"></iframe>
<script>
window.onload = function() {
let onloadStart = performance.now();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<h1>Dondon</h1>
<iframe width="400" height="500" src="http://sefeng.me/testing/slow_response_2.html"></iframe>
@sefeng211
sefeng211 / create_server_blocks_nginx.sh
Created August 3, 2019 02:05
This is the script that I used to setup a server block for Nginx. Please make sure you have change $DOMAIN to your site and double check the $ROOT_LOCATION
#!/bin/bash
# This script used https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04 as the reference
DOMAIN="sample.seanfeng.dev" # Change it to the domain you want to add
ROOT_LOCATION=/var/www # Make sure it is your root location
HTML_TEMPLATE="
<html>
from __future__ import print_function
import json
import os.path
import glob
import math
import statistics
from shutil import copyfile
from operator import itemgetter
@sefeng211
sefeng211 / extension.js
Last active February 14, 2020 18:25
Place it under node_modules/selenium-webdriver/firefox/extension.js
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The SFC licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
@sefeng211
sefeng211 / extension_diff.patch
Last active February 14, 2020 22:47
Apply this patch to node_modules/selenium-webdriver/firefox/extension.js
--- node_modules/selenium-webdriver/firefox/extension.js 2019-04-23 17:15:51.000000000 -0400
+++ extension_new.js 2020-02-14 13:27:28.221885022 -0500
@@ -176,6 +176,14 @@
return {id: applications.gecko.id, name, version, unpack: false};
}
+ function setApplication(parsedJSON) {
+ let { browser_specific_settings } = parsedJSON;
+ if (browser_specific_settings && browser_specific_settings.gecko) {
+ parsedJSON.applications = browser_specific_settings;
@sefeng211
sefeng211 / clang-format
Created March 14, 2020 23:16
mozilla's clang-format for firefox. Save it as .clang-format
BasedOnStyle: Google
# Prevent the loss of indentation with these macros
MacroBlockBegin: "^\
JS_BEGIN_MACRO|\
NS_INTERFACE_MAP_BEGIN|\
NS_INTERFACE_TABLE_HEAD|\
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION|\
NS_IMPL_CYCLE_COLLECTION_.*_BEGIN|\
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED|\
<!DOCTYPE html>
<html>
<head>
<style>
body {
height: 10000px;
margin: 0;
}
<html>
<style>
div {
inset-inline-start: 400px;
width: 300px;
height: 400px;
background-color:yellow;
position: absolute;
}
</style>
diff -x '*.json' -x '*.pp' -x '*.mk' -x '*.o' ../.build/gamma-debug-old/dom/bindings/AudioParamMapBinding.cpp ../.build/gamma-debug/dom/bindings/AudioParamMapBinding.cpp
94,95c94
< // That threw an exception on the JSContext, and our CallSetup will do
< // the right thing with that.
---
> aRv.Throw(NS_ERROR_UNEXPECTED);
146,147c145
< // That threw an exception on the JSContext, and our CallSetup will do
< // the right thing with that.
---