Skip to content

Instantly share code, notes, and snippets.

STDERR.puts "Listing backups"
Backup.find_each.map do |backup|
print(backup.dump.url + "\n")
end
STDERR.puts "Listing imports"
Import.find_each.map do |import|
print(import.data.url + "\n") unless import.data.url == "/data/original/missing.png"
end
@progval
progval / factoids_upgrade_db.py
Created March 26, 2022 06:24
factoids_upgrade_db.py
# Migration script for https://github.com/ProgVal/Limnoria/commit/436d2bade8557111d13a586ab845ed43ff5872c8
import sqlite3
import sys
try:
(_, old_path, new_path) = sys.argv
except ValueError:
print("Syntax: %s <path_to_old.db> <path_to_new.db>")
exit(1)
@progval
progval / freenode-resign-letter.txt
Created May 19, 2021 11:14 — forked from aaronmdjones/freenode-resign-letter.txt
My resignation from freenode
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
My resignation from freenode staff
==================================
I joined the freenode staff in March 2019 [1].
Before I joined the staff, Freenode Ltd was sold [2] to a person named
Andrew Lee as part of a sponsorship deal. The informal terms of that
diff --git a/pst/build.gradle b/pst/build.gradle
index 9b4dc857..9eb8aa44 100644
--- a/pst/build.gradle
+++ b/pst/build.gradle
@@ -109,7 +109,7 @@ checkstyleMain.source = "src/main/java" // only checks the manually written java
//=============================================================================
protobuf {
protoc {
- artifact = 'com.google.protobuf:protoc:2.6.1'
+ path = '/home/wave-sandbox/.local/bin/protoc'
[nix-shell:~/nixpkgs/source]$ tools/bin/minicargo rustc-1.29.0-src/src/vendor/libssh2-sys/ --vendor-dir rustc-1.29.0-src/src/vendor/ --output-dir output/cargo-build -L output/
(0/7) BUILDING cc v1.0.18
> /home/val/nixpkgs/source/bin/mrustc rustc-1.29.0-src/src/vendor/cc/src/lib.rs -o output/cargo-build/libcc-1_0_18.rlib --crate-name cc --crate-type rlib -C emit-depfile=output/cargo-build/libcc-1_0_18.rlib.d --crate-tag 1_0_18 -g --cfg debug_assertions -O -L output -L output/cargo-build
(1/7) BUILDING cmake v0.1.31
> /home/val/nixpkgs/source/bin/mrustc rustc-1.29.0-src/src/vendor/cmake/src/lib.rs -o output/cargo-build/libcmake-0_1_31.rlib --crate-name cmake --crate-type rlib -C emit-depfile=output/cargo-build/libcmake-0_1_31.rlib.d --crate-tag 0_1_31 -g --cfg debug_assertions -O -L output -L output/cargo-build --extern cc=output/cargo-build/libcc-1_0_18.rlib
(2/7) BUILDING pkg_config from pkg-config v0.3.11
> /home/val/nixpkgs/source/bin/mrustc rustc-1.29.0-src/src/vendor/pkg-config/src/lib.rs -o output/cargo-
@progval
progval / selectLlvm.patch
Created April 19, 2020 12:23
selectLlvm.patch
diff --git a/pkgs/development/compilers/rust/1_29.nix b/pkgs/development/compilers/rust/1_29.nix
index ba76e6555ce..d0a494b03af 100644
--- a/pkgs/development/compilers/rust/1_29.nix
+++ b/pkgs/development/compilers/rust/1_29.nix
@@ -11,7 +11,7 @@ import ./default.nix {
rustcVersion = "1.29.0";
rustcSha256 = "1sb15znckj8pc8q3g7cq03pijnida6cg64yqmgiayxkzskzk9sx4";
- llvm = llvm_7;
+ selectLlvm = pkgs: pkgs.llvm_7;
@progval
progval / mindustry_log.patch
Last active February 23, 2020 21:16
Mindustry log builds
diff --git a/core/src/mindustry/graphics/MinimapRenderer.java b/core/src/mindustry/graphics/MinimapRenderer.java
index c34bb246e..84a8b8d5e 100644
--- a/core/src/mindustry/graphics/MinimapRenderer.java
+++ b/core/src/mindustry/graphics/MinimapRenderer.java
@@ -92,9 +92,13 @@ public class MinimapRenderer implements Disposable{
float rx = !withLabels ? (unit.x - rect.x) / rect.width * w : unit.x / (world.width() * tilesize) * w;
float ry = !withLabels ? (unit.y - rect.y) / rect.width * h : unit.y / (world.height() * tilesize) * h;
- Draw.mixcol(unit.getTeam().color, 1f);
+ Draw.color(unit.getTeam().color);
@progval
progval / rule90.rs
Last active February 1, 2023 20:21
#![recursion_limit="1024"]
macro_rules! rule90 {
// Initialization
( ($($fuel:tt)*) | $($cells:tt,)* ) => {
rule90!( __cont ($($fuel)*) | ($($cells,)*) | (($($cells,)*)) );
};
// Initialize the line
( __cont (f $($fuel:tt)*) | ($($cells:tt,)*) | ($(($($history:tt,)*))* ) ) => {
diff --git a/src/drivers/Socket.py b/src/drivers/Socket.py
index c9e9d19f..08787fb4 100644
--- a/src/drivers/Socket.py
+++ b/src/drivers/Socket.py
@@ -223,7 +223,13 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
def connect(self, **kwargs):
self.reconnect(reset=False, **kwargs)
- def reconnect(self, wait=False, reset=True):
+ def reconnect(self, **kwargs):
@progval
progval / main.rs
Created June 19, 2018 23:17 — forked from Yatekii/main.rs
use nom::types::CompleteStr;
use std::str;
use nom::space;
use nom::types::CompleteByteSlice;
//use geometry::SchemaPoint2D;
pub struct SchemaPoint2D(f32, f32);
impl SchemaPoint2D {
fn new(x:f32, y:f32) -> SchemaPoint2D {