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
<!DOCTYPE html> | |
<!-- saved from url=(0047)file:///tmp/cover1217815835/coverage.html#file3 --> | |
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>adiantum: Go Coverage Report</title> | |
<style> | |
body { | |
background: black; | |
color: rgb(80, 80, 80); | |
} |
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
using System; | |
using UnityEngine; | |
/// <summary> | |
/// Base class for <see cref="MonoBehaviour"/> of which there should be a single instance. | |
/// </summary> | |
/// <threadsafety>This class is <b>not</b> thread safe.</threadsafety> | |
public abstract class MonoSingleton<T> : MonoBehaviour where T : MonoSingleton<T> | |
{ | |
static volatile T instance; |
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 | |
exec zenity.exe --unixeol --cygpath "$@" |
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 io.github.ncruces.utils; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.Reader; | |
import java.nio.ByteBuffer; | |
import java.nio.CharBuffer; | |
import java.nio.charset.Charset; | |
import java.nio.charset.CharsetEncoder; | |
import java.nio.charset.CoderResult; |
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 regexp(...args) { | |
function cleanup(string) { | |
// remove whitespace, single and multi-line comments | |
return string.replace(/\s+|\/\/.*|\/\*[\s\S]*?\*\//g, ''); | |
} | |
function escape(string) { | |
// escape regular expression | |
return string.replace(/[-.*+?^${}()|[\]\\]/g, '\\$&'); | |
} |
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
// https://tools.ietf.org/html/rfc5952 | |
function parseIPv6(addr) { | |
// does it have an IPv4 suffix | |
let ipv4 = /^([\s\S]*):(\d+)\.(\d+)\.(\d+)\.(\d+)$/.exec(addr); | |
if (ipv4) { | |
// dot-decimal to ints | |
let dec = ipv4.slice(2).map(s => parseInt(s, 10)); | |
if (dec.some(i => i > 255)) return null; | |
// ints to hexs | |
let hex = dec.map(i => ('0' + i.toString(16)).substr(-2)); |
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
// A Cloudflare worker that uses https://dns.google to offer DNS64 over HTTP | |
// for any NAT64 prefix. | |
// | |
// Google's DNS64 service only supports the 64:ff9b::/96 'well know prefix', | |
// which is not publicly routable over the internet. | |
// See https://nat64.xyz/ for a list of publicly available NAT64 services and | |
// their prefixes. | |
// | |
// To use this, deploy it to a worker, and then configure your DNS over HTTPS | |
// resolver with this URL (specify more than one prefix for redundancy): |
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 hammersley(n, bias) { | |
if (isNaN(bias)) bias = (1-n)/(n+n); | |
function phi2(n) { | |
let r = 0; | |
let b = n.toString(2); | |
for (let i = 0; i < b.length; ++i) { | |
if (Number(b[i])) r += 1/(1 << b.length-i); | |
} | |
return r; |
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
param( | |
[Parameter(Mandatory=$true)] | |
[String]$rule | |
) | |
$ipv4 = (Invoke-WebRequest -UseBasicParsing -Uri "https://www.cloudflare.com/ips-v4").Content | |
$ipv6 = (Invoke-WebRequest -UseBasicParsing -Uri "https://www.cloudflare.com/ips-v6").Content | |
$ips = ($ipv4 + $ipv6).TrimEnd().Split([Environment]::NewLine) | |
Set-NetFirewallRule -DisplayName $rule -RemoteAddress $ips |
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 io.github.ncruces.utils; | |
import android.graphics.Bitmap; | |
import androidx.annotation.IntDef; | |
import androidx.annotation.NonNull; | |
import androidx.annotation.RequiresApi; | |
import com.sun.jna.JNIEnv; | |
import com.sun.jna.Native; |
NewerOlder