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
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
async function handleRequest(request) { | |
let url = request.url | |
if (url.indexOf("://") !== -1) { | |
url = url.substring(url.indexOf("://") + "://".length) | |
} | |
if (url.indexOf("/") !== -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
FROM ubuntu:20.04 | |
RUN apt update | |
RUN apt install -y wget ca-certificates build-essential zlib1g zlib1g-dev locales | |
# configure locales first | |
RUN locale-gen zh_CN | |
RUN locale-gen zh_CN.utf8 | |
ENV LANG zh_CN.UTF-8 |
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 java.util.function.*; | |
class JDBC { | |
void transaction(Consumer<ConnectionW> f) { | |
f.accept(new ConnectionW()); | |
} | |
<T> T transaction(Function<ConnectionW, T> f) { | |
return f.apply(new ConnectionW()); | |
} | |
} |
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
public class Main { | |
public static void main(String[] args) { | |
var arr = new byte[(1024 * 1024)][]; | |
new Thread(() -> { | |
while (true) { | |
var total = Runtime.getRuntime().totalMemory(); | |
System.out.println(total); | |
try { | |
Thread.sleep(5 * 1000); | |
} catch (Exception ignore) { |
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
// ==UserScript== | |
// @name setgrayscale | |
// @version 0.1 | |
// @description x | |
// @author wkgcass | |
// @match *://*/* | |
// ==/UserScript== | |
(function() { | |
'use strict'; |
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 com.sun.jna.Native; | |
import com.sun.jna.Structure; | |
import com.sun.jna.win32.StdCallLibrary; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.List; | |
public class Main { |
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
$def = @" | |
using System; | |
using System.Runtime.InteropServices; | |
using System.Collections.Generic; | |
namespace SetAppVolume | |
{ | |
public class AppMuter | |
{ | |
public static void Mute(string app) |
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 javax.net.ssl.SSLParameters; | |
import java.net.URI; | |
import java.net.http.HttpClient; | |
import java.net.http.HttpRequest; | |
import java.net.http.HttpResponse; | |
import java.time.Duration; | |
import java.util.Date; | |
import java.util.concurrent.atomic.AtomicLong; | |
public class X { |
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
package vproxybase.util.time.timewheel; | |
import vproxybase.util.LogType; | |
import vproxybase.util.Logger; | |
import vproxybase.util.time.TimeElem; | |
public class TimeElemImpl<T> implements TimeElem<T> { | |
final long timeoutTs; | |
private final T value; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include "lsqpack.h" | |
#include "lsxpack_header.h" | |
void dhi_unblocked(void* hblock_ctx) { | |
printf("dhi_unblocked\n"); | |
} | |
typedef struct st_hblock_ctx { |
NewerOlder