Skip to content

Instantly share code, notes, and snippets.

@Korvox
Korvox / fac.rs
Created August 10, 2025 18:12
script to rip data from baltimore real property geojson
use std::str::FromStr;
pub struct Parcel<'a> {
pub block: u16,
pub lot: u16,
pub land: u64,
pub size: &'a str,
pub addr: &'a str,
pub owner1: &'a str,
}
@Korvox
Korvox / trains.py
Created April 7, 2025 23:57
Simple python calculator for trip lengths given tunables for a rail corridor
import math
# each segment is length in miles and maximum top speed on that segment in mph
segments = [(3,50), (2.3,125), (2.3,125), (2.2,125), (4,125), (3,125), (3.5,125), (5,125), (3,125), (4,125), (2.7,125)]
# maximum speed of the trainset
peak = 125
# in gs applied, 0.1 + 0.12 are max to not have freestanding passengers fall over
accel = 0.1
decel = 0.12
# min amount of time train needs to coast between stations so you aren't just accelerating and decelerating all the time
@Korvox
Korvox / PKGBUILD
Created December 14, 2024 05:43
gridcoinresearch-qt-git new pkgbuild
pkgname=gridcoinresearch-qt-git
_name=Gridcoin-Research
pkgver=5.4.8.0.r79.g6f728b0
pkgrel=1
pkgdesc="GridCoin is a cryptocurrency that helps science via BOINC - Qt - git branch"
depends=(boost-libs leveldb qrencode qt5-base qt5-charts libzip miniupnpc curl boinc vim)
makedepends=(boost cmake git qt5-tools qrencode)
arch=('i686' 'x86_64' 'armv7h' 'aarch64')
url="https://gridcoin.us"
license=('custom:gridcoin')
diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp
index 14921028c..be8b13be7 100644
--- a/src/ui/mainwindow.cpp
+++ b/src/ui/mainwindow.cpp
@@ -1444,17 +1444,9 @@ void MainWindow::StopAfterCurrent() {
}
void MainWindow::closeEvent(QCloseEvent* event) {
- bool keep_running(false);
- if (tray_icon_)
@Korvox
Korvox / qt5.diff
Created November 7, 2019 23:27
Qt5 modifications for clementine-git
diff --git a/PKGBUILD b/PKGBUILD
index 2c0755a..7fa3c80 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,50 +8,42 @@
# Based on community/clementine PKGBUILD
pkgname=clementine-git
-pkgver=1.3.1.r392.g83e860eab
+pkgver=1.3.1.r852.gf9627c208
@Korvox
Korvox / getprod.c
Last active September 26, 2019 05:17
Script trying to get product ids from xinput
#include <stdio.h>
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <X11/extensions/XInput.h>
#include <X11/extensions/XInput2.h>
#include <xorg/xserver-properties.h>
int main() {
Display *dpy = XOpenDisplay(NULL);
int ndevices;
String 1: b'UGTABLET'
String 2: b'15.6 inch PenDisplay'
String 3: b'000000'
String 4: b'UG901_LPU1503'
String 5: b'2019-03-12_Factory.'
String 20: b'Test Mode0'
String 21: b'Test Mode1'
String 22: b'Test Mode2'
String 23: b'Test Mode3'
String 24: b'Test Mode4'
@Korvox
Korvox / rkt-macro-test
Created November 30, 2018 02:55
Gets cannot find `__req` & '__data' in this scope errors
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use]
extern crate rocket;
macro_rules! index {
($type:ty) => {
#[get("/")]
fn index(thing: rocket::State<$type>) -> String {
format!("Thing: {}", *thing)
Screen 0: minimum 8 x 8, current 7680 x 2160, maximum 32767 x 32767
DP1 connected primary 3840x2160+1920+0 (normal left inverted right x axis y axis) 600mm x 340mm
3840x2160 60.00*+ 30.00
2560x1440 59.95
1920x1080 60.00 59.94
1600x900 60.00
1280x1024 60.02
1280x800 59.81
1152x864 59.97
1280x720 60.00 59.94
// g++ -lcryptopp rsa.cpp -o rsa
#include <iostream>
#include <string>
#include "cryptopp/rsa.h"
#include "cryptopp/osrng.h"
#include <cryptopp/files.h>
using namespace std;