This file contains hidden or 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
| trait IteratorEx: Iterator { | |
| fn multi_fold<B, F: FnMut(B, Self::Item) -> Result<(B, B), B>>( | |
| self, | |
| init: B, | |
| folder: F, | |
| ) -> MultiFold<B, Self, F> | |
| where | |
| Self: Sized, | |
| { | |
| MultiFold { |
This file contains hidden or 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(extend_one)] | |
| #![feature(generic_const_exprs)] | |
| #![allow(incomplete_features)] | |
| mod internals { | |
| struct Cond<const VAL: bool> {} | |
| trait IsTrue {} | |
| impl IsTrue for Cond<true> {} |
This file contains hidden or 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
| (function () { | |
| "use strict"; | |
| const originalCustomElements = window.customElements; | |
| const originalPropertyDescriptor = Object.getOwnPropertyDescriptor(window, "customElements"); | |
| const newCustomElements = { | |
| get(name) { | |
| return originalCustomElements.get(name) | |
| }, | |
| define(name, constructor, options) { | |
| if (name === "g-emoji") { |
This file contains hidden or 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 Fix Github Mobile | |
| // @encoding utf-8 | |
| // @match *://*.github.com/* | |
| // @compatible chrome | |
| // @compatible firefox | |
| // @compatible opera | |
| // @compatible safari | |
| // @compatible edge | |
| // @run-at document-idle |
This file contains hidden or 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(negative_impls, with_negative_coherence)] | |
| #[derive(Debug)] | |
| struct A; | |
| #[derive(Debug)] | |
| struct B; | |
| #[derive(Debug)] | |
| enum Foo { |
This file contains hidden or 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
| --- Generate a version 7 UUID in PL/pgSQL as specified in the draft (https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-04.html) | |
| CREATE OR REPLACE FUNCTION uuid_generate_v7() RETURNS uuid AS $$ | |
| DECLARE | |
| raw bytea; | |
| tsbits bit(48); | |
| BEGIN | |
| raw := decode(replace(uuid_generate_v4()::text, '-', ''), 'hex'); | |
| tsbits := (extract(epoch from clock_timestamp()) * 1000)::bigint::bit(48); | |
| --- set unix timestamp (big endian) in the upper 48 bits/6 bytes |
This file contains hidden or 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
| #![no_std] | |
| #![feature(link_llvm_intrinsics)] | |
| extern "C" { | |
| #[link_name = "llvm.memcpy.inline.p0.p0.i64"] | |
| fn llvm_memcpy_inline(dst: *mut (), src: *const (), len: usize, is_volatile: bool); | |
| } | |
| #[inline(always)] | |
| unsafe fn memcpy_inline<const N: usize>(dst: *mut (), src: *const ()) { |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains hidden or 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
| Afghanistan;AF;AFG | |
| Aland Islands;AX;ALA | |
| Åland Islands;AX;ALA | |
| Albania;AL;ALB | |
| Algeria;DZ;DZA | |
| American Samoa;AS;ASM | |
| Andorra;AD;AND | |
| Angola;AO;AGO | |
| Anguilla;AI;AIA | |
| Antarctica;AQ;ATA |
This file contains hidden or 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::{ | |
| cell::UnsafeCell, | |
| panic::{self, AssertUnwindSafe}, | |
| sync::atomic::{AtomicBool, AtomicPtr, Ordering}, | |
| thread::{self, Thread}, | |
| unreachable, | |
| }; | |
| use sptr::Strict; |
This file contains hidden or 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::{ | |
| process::exit, | |
| time::{SystemTime, UNIX_EPOCH}, | |
| }; | |
| use hmac::{Hmac, Mac}; | |
| use sha1::Sha1; | |
| type HmacSha1 = Hmac<Sha1>; |