Skip to content

Instantly share code, notes, and snippets.

Avatar

Alice Ryhl Darksonn

View GitHub Profile
@Darksonn
Darksonn / test.log
Created Jun 5, 2020
MacOS test #2590
View test.log
2020-06-05T17:29:12.0015250Z ##[section]Starting: tokio - cargo test --all-features
2020-06-05T17:29:12.0025270Z ==============================================================================
2020-06-05T17:29:12.0025860Z Task : Command line
2020-06-05T17:29:12.0026410Z Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2020-06-05T17:29:12.0026920Z Version : 2.164.2
2020-06-05T17:29:12.0027340Z Author : Microsoft Corporation
2020-06-05T17:29:12.0027870Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2020-06-05T17:29:12.0028450Z ==============================================================================
2020-06-05T17:29:12.1545660Z Generating script.
2020-06-05T17:29:12.1567410Z Script contents:
View tk-stack.js
function onscrollUpdateStacks(stackElems, lines) {
var i;
var stackBox = stackElems[0][0].getBoundingClientRect();
var stackMid = (stackBox.top + 3*stackBox.bottom) / 4.0;
var current = -1;
var currentY = -Infinity;
// Find the thing to highlight.
for (i = 0; i < stackElems.length; ++i) {
var divBox = stackElems[i][1].getBoundingClientRect();
@Darksonn
Darksonn / compile.sh
Created Feb 2, 2020
Staticly link qbittorrent v4.1.9.1
View compile.sh
#!/bin/bash
set -e
QBITTORRENT_TAG=release-4.1.9.1
LIBTORRENT_TAG=RC_1_1
QT5_TAG=5.12
BOOST_VER=1.69.0
BOOST_BUILD_TAG=boost-$BOOST_VER
rm -rf work
@Darksonn
Darksonn / killswitch.rs
Last active Sep 7, 2019
Kill switch for hyper sockets
View killswitch.rs
#[derive(Clone)]
pub struct KillSwitch {
kill: Arc<AtomicBool>,
}
impl KillSwitch {
pub fn new() -> Self {
KillSwitch {
kill: Arc::new(AtomicBool::new(false)),
}
}
@Darksonn
Darksonn / Cargo.toml
Last active Feb 10, 2022
Hyper example
View Cargo.toml
[package]
name = "hyperexample"
version = "0.1.0"
authors = ["Alice Ryhl <alice@ryhl.io>"]
edition = "2018"
[dependencies]
hyper = "0.12"
hyper-tls = "0.3"
tokio = "0.1"
View gist:d56a67761727f1dce3daf33f916fe4c3
### Keybase proof
I hereby claim:
* I am Darksonn on github.
* I am aliceryhl (https://keybase.io/aliceryhl) on keybase.
* I have a public key whose fingerprint is 49F6 C1FA A749 60F4 3A5B 86A1 EE7A 392F DE96 209F
To claim this, I am signing this object:
View ModulusFinder.java
public class ModulusFinder {
public static void main(String[] args) {
int i = 0;
while (!test(i)) {
System.out.println(i++);
}
System.out.println("lowest answer: " + i);
}
static boolean test(int x) {
@Darksonn
Darksonn / BigFraction.java
Created Dec 13, 2013
Calculates the logarithm of an argument arguments: number [precision, default is 250] [base, default is e]
View BigFraction.java
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.WeakHashMap;
/**
* Stores 2 {@link BigInteger}s, one numerator and one denominator, these two values then define a fraction.<br>
* Creating a BigFraction which has another instance with the same value somewhere else, a new one will not be created but the other value is returned.<br>
* Because of this, == can be used for comparing the fractions and yield correct results.