Skip to content

Instantly share code, notes, and snippets.

@Nemo157
Nemo157 / _Publishing crates to IPFS.md
Last active March 26, 2024 20:46
Publishing crates to IPFS

Publishing crates to IPFS

This was an experiment in seeing how feasible it would be to distribute crates on IPFS using the alternative registries feature combined with a local IPFS web gateway.

There was very little plan for this originally, and I wish I had kept more of the intermediate states as I went through multiple major design changes. My original goal was to publish my CLI utility [bs58-cli][] and its dependency tree.

// ==UserScript==
// @name Code 55% faster with GitHub Copilot!
// @description Code 55% faster with GitHub Copilot!
// @version 55.6
// @downloadURL https://gist.github.com/Nemo157/a4df65856b79d50f184974a475c7ce98/raw/Code%252055%2525%2520faster%2520with%2520GitHub%2520Copilot!.user.js
// @updateURL https://gist.github.com/Nemo157/a4df65856b79d50f184974a475c7ce98/raw/Code%252055%2525%2520faster%2520with%2520GitHub%2520Copilot!.user.js
// @match https://github.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
// ==/UserScript==
@Nemo157
Nemo157 / Makefile
Created August 19, 2010 23:43
A simple Makefile for LaTeX projects.
# Author:
# Wim Looman
# Copyright:
# Copyright (c) 2010 Wim Looman
# License:
# GNU General Public License (see http://www.gnu.org/licenses/gpl-3.0.txt)
## User interface, just set the main filename and it will do everything for you
# If you have any extra code or images included list them in EXTRA_FILES
# This should work as long as you have all the .tex, .sty and .bib files in
@Nemo157
Nemo157 / tool.rs
Last active August 13, 2023 21:01
//! ```cargo
//! package.edition = "2021"
//! [dependencies]
//! serde-xml-rs = "0.6.0"
//! quick-xml = { version = "0.30.0", features = ["serialize"] }
//! serde = { version = "=1.0.171", features = ["derive"] }
//! clap = { version = "4.3.21", features = ["derive"] }
//! anyhow = "1.0.72"
//! culpa = "1.0.1"
//! ```
class Map
def initialize width, height
@values = Array.new(width){ Array.new(height){ nil } }
end
def [](x, y)
@values[x][y]
end
def []=(x, y, value)
/* ==UserStyle==
@name zulip-archive.rust-lang.org ayu-like
@namespace https://gist.github.com/Nemo157/b30e9687927117836b09773f73e7e1cc
@version 1.0.2
==/UserStyle== */
@-moz-document domain("zulip-archive.rust-lang.org") {
body {
background-color: #0f1419;
}
/* ==UserStyle==
@name bandcamp.com
@namespace https://gist.github.com/Nemo157/f487aff9fb49c93367c190ec22055307
@version 1.0.0
==/UserStyle== */
@-moz-document domain("bandcamp.com") {
li[data-item-id^="track"] {
opacity: 0.3;
@Nemo157
Nemo157 / generator_sink.rs
Last active June 23, 2020 15:06
An attempt at working out how to shim an argument accepting generator into a Sink
#![feature(generator_trait)]
#![feature(generators)]
use core::pin::Pin;
use core::task::{Context, Poll};
use core::ops::{Generator, GeneratorState};
pub trait Sink<Item> {
type Error;
@Nemo157
Nemo157 / .gitignore
Last active November 18, 2019 12:13
hyper on async-std
target/
// MIR for `main::{{closure}}`
// source = MirSource { def_id: DefId(0/1:9 ~ generators[317d]::main[0]::{{closure}}[0]), promoted: None }
// pass_name = generator_resume
// disambiguator = 0
// generator_layout = GeneratorLayout { fields: [LocalDecl { mutability: Not, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutImmutable), opt_ty_info: None, opt_match_place: Some((None, src/test/debuginfo/generators.rs:37:17: 37:18)), pat_span: src/test/debuginfo/generators.rs:37:13: 37:14 }))), internal: false, is_block_tail: None, ty: i32, user_ty: UserTypeProjections { contents: [] }, name: Some(d), source_info: SourceInfo { span: src/test/debuginfo/generators.rs:37:13: 37:14, scope: scope[2] }, visibility_scope: scope[1] }] }
fn main::{{closure}}(_1: std::pin::Pin<&mut [generator@src/test/debuginfo/generators.rs:36:17: 41:6 a:&mut i32 {i32, ()}]>) -> std::ops::GeneratorState<(), ()>{
let mut _0: std::ops::GeneratorState<(), ()>; // return place
scope 1 {
}