This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(slice_split_once)] | |
use std::{ | |
cmp::{max, min}, | |
collections::hash_map::Entry, | |
env::args_os, | |
fs::File, | |
io::{stdout, Write as _}, | |
path::Path, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name No Trending | |
// @version 0.1 | |
// @description Turn off twitter trending | |
// @author You | |
// @match https://twitter.com/* | |
// @icon https://www.google.com/s2/favicons?domain=twitter.com | |
// @require https://raw.githubusercontent.com/muicss/sentineljs/master/dist/sentinel.min.js | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{ | |
marker::PhantomData, | |
mem::MaybeUninit, | |
ops::Deref, | |
process::abort, | |
ptr::NonNull, | |
sync::atomic::{AtomicU32, Ordering}, | |
}; | |
const MAX_REFCOUNT: u32 = i32::MAX as u32; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub mod sort; | |
use serde::de; | |
#[derive(Debug, Clone, Copy)] | |
pub struct DepthLimiter<T> { | |
depth: usize, | |
inner: T, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"title": "Nathan's", | |
"data": { | |
"BASE_PLANET_MOD": 1, | |
"RESOURCES_MULTIPLIER": 3, | |
"INFLUENCE_MULTIPLIER": 2, | |
"TECH_MOD": 5, | |
"TECH_PROPULSION_MOD": 0, | |
"TECH_WARFARE_MOD": 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use rmp_serde::Raw; | |
use serde::{ser, Serialize}; | |
use thiserror::Error; | |
/// Serializer that serializes strings as a list of char | |
struct CharListSerializer { | |
output: Vec<char>, | |
} | |
#[derive(Debug, Error)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{convert::Infallible, marker::PhantomData, mem}; | |
use serde::de; | |
pub trait SeqAccess<'de>: Sized { | |
type Error: de::Error; | |
fn next_value_seed<S>(self, seed: S) -> Result<Option<(S::Value, Self)>, Self::Error> | |
where | |
S: de::DeserializeSeed<'de>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use nom::{ | |
branch::alt, | |
character::complete::{alpha1, char, digit1, multispace1}, | |
combinator::eof, | |
IResult, Parser, | |
}; | |
use nom_supreme::{error::ErrorTree, multi::collect_separated_terminated, ParserExt}; | |
#[derive(Debug, Clone)] | |
struct Structure<'a> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "liscpp.h" | |
using namespace std; | |
int main() | |
{ | |
ReadEvalPrint( | |
(Let, | |
tok(fold), (Lambda, tok(F), tok(I), tok(L), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fetch several rows from 1 or more pages from an API. Concatenate all | |
// the rows together. | |
function fetch_paginated( | |
// The URL to initiate the query | |
initial_url, | |
// A fetch function that retrieves a single page. Intended to wrap a fetch() | |
// API call (so that you can add your own headers, auth, response parsing, | |
// etc) | |
fetcher, |
NewerOlder