This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Simple HTML streaming concept, inspired by how NextJS do it, but without | |
* React. | |
* | |
* It works by initially sending a skeleton HTML to the browser, but, | |
* importantly, this skeleton is unclosed, which allows server to stream in | |
* more content. However, you cannot go back to edit the HTML content you've | |
* already sent. Or can you??? | |
* | |
* Turns out, if the additional content is a <script> tag which changes the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { setTimeout } from "node:timers/promises"; | |
import express from "express"; | |
/* Simple HTML streaming concept, inspired by now NextJS do it, but without React. | |
* TODO: figure out why in the world does Firefox not show the "Loading..." as soon | |
* as it's received. | |
*/ | |
async function getContent() { | |
await setTimeout(5000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bindWeakImpl< | |
TFn extends (...args: any) => any, | |
TTarget extends object, | |
>(fn: TFn, weakTarget: WeakRef<TTarget>, defaultReturn: ReturnType<TFn>) | |
{ | |
return function(...args: Parameters<TFn>): ReturnType<TFn> { | |
const target = weakTarget.deref(); | |
if (target === undefined) { | |
console.debug(`bindWeak: target of ${fn} is now unreachable. Return ${defaultReturn}`); | |
return defaultReturn; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# User: replace "system-update" below to your plugin of interest. | |
BEGIN { | |
plugin_name = "system-update" | |
plugin_pat = "/plugins/" plugin_name "/" | |
} | |
$0 ~ /^#\. TRANSLATORS: This is a keyword or name for the / { | |
if ($11 == plugin_name) { | |
has_keyword=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -e debian/ubports.source_location ] && ! [ -e .pc/ ]; then | |
# Fetch & extract source | |
sudo apt install --no-install-recommends -y devscripts quilt | |
( | |
{ read -r url; read -r file; } < debian/ubports.source_location | |
wget -O "../${file}" "$url" | |
) | |
origtargz --unpack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOCAL_PATH := $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_MODULE := libpeat-test | |
LOCAL_SRC_FILES := lib.cpp | |
include $(BUILD_SHARED_LIBRARY) | |
include $(CLEAR_VARS) | |
LOCAL_MODULE := peat-test-app | |
LOCAL_SRC_FILES := app.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CCACHEDIR=/var/cache/pbuilder/ccache/ | |
EXTRAPACKAGES=pkg-create-dbgsym | |
export DEB_BUILD_OPTIONS=parallel=`nproc` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/system/bin/sh | |
echo 'function_graph' >/sys/kernel/debug/tracing/current_tracer | |
echo 96000 > /d/tracing/buffer_size_kb | |
echo $$ > /sys/kernel/debug/tracing/set_ftrace_pid | |
echo 1 > /sys/kernel/debug/tracing/tracing_on | |
( | |
sleep 10 # stop tracing after this second. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem set the version of jdk you would like to use (1.4, 1.5, 1.6, etc) | |
set JDK_Version=1.8 | |
set Located= | |
echo. | |
echo Locating JDK %JDK_Version% | |
for /d %%i in ("%ProgramFiles%\Java\jdk%jdk_Version%*") do (set Located=%%i) | |
rem check if JDK was located |
NewerOlder