Skip to content

Instantly share code, notes, and snippets.

View Holger-Will's full-sized avatar
🎯
Focusing

Holger Will Holger-Will

🎯
Focusing
View GitHub Profile
@Holger-Will
Holger-Will / install-drive.sh
Last active July 20, 2020 06:21
installscript for odeke-em/drive
sudo apt install golang
mkdir ~/gopath
echo export GOPATH=\$HOME/gopath >> ~/.bashrc
echo export PATH=\$GOPATH:\$GOPATH/bin:\$PATH >> ~/.bashrc
source ~/.bashrc
go get -u -v github.com/odeke-em/drive/cmd/drive
mkdir ~/gdrive
drive init ~/gdrive
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/**
* Calculates the AMZ Warehouse fees
*
* @param {number} TotalAmount The total amount you plan to send to the warehouse
* @param {number} SellsPerDay The amout you sell per day.
* @param {number} PackageSize The size of the package in m³
* @param {number} AMZFee The AMZ warehouse fee (normal fee: 26€).
* @return the total cost for storing the supplied amount until it
* @customfunction
*/
@Holger-Will
Holger-Will / übergang.html
Created June 11, 2019 14:15
kanalübergang
<html>
<head>
<title></title>
<meta content="">
<style>
.r1{stroke:#999}
.r2{stroke:#333;}
</style>
</head>
<body>
var d1 = Buffer.from("08","hex")
console.log(pack(d1,5).toString("hex"))
// pack(data-buffer,packet-type,optional-data-buffer)
function hex(num,pad){
return num.toString(16).padStart(pad,"0")
}
@Holger-Will
Holger-Will / wall
Created September 14, 2018 03:58
wall
module wall(width,height,windows,doors){
difference(){
color("white") cube([width,20,height]);
for(w=windows){
color("white") translate([w[2],-10,w[3]]) cube([w[0],40,w[1]]);
}
}
for(w=windows){
translate([w[2],-10,w[3]]) window(w[0],w[1]);
}
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<style>
svg{background:grey;width:400px;height:400px}
</style>
</head>
<body>
@Holger-Will
Holger-Will / flatten.js
Created July 18, 2018 06:22
convert an svg path to line segments
function flatten(path,num){
var l = path.getTotalLength()
var p = path.getPointAtLength(0)
var d = `M${p.x} ${p.y}`
for(var i = (l/num);i<=l;i+=(l/num)){
p = path.getPointAtLength(i)
d+=`L${p.x} ${p.y}`
}
path.setAttribute("d",d+"z")
}
diff --git a/nheqminer/libstratum/ZcashStratum.cpp b/nheqminer/libstratum/ZcashStratum.cpp
index 7eac7199..6cc047bf 100644
--- a/nheqminer/libstratum/ZcashStratum.cpp
+++ b/nheqminer/libstratum/ZcashStratum.cpp
@@ -490,7 +490,7 @@ ZcashJob* ZcashMiner::parseJob(const Array& params)
// TODO: On a LE host shouldn't this be le32toh?
ret->header.nVersion = be32toh(version);
- if (ret->header.nVersion == 4) {
+ if (ret->header.nVersion > 29) { //BIP 9
@Holger-Will
Holger-Will / jwtRS256.sh
Last active January 8, 2024 13:17
generate public private key pair (RSA RS256) for use with koa-jwt jasonwebtoken etc.
# generate private key
openssl genrsa -out private.pem 2048
# extatract public key from it
openssl rsa -in private.pem -pubout > public.pem