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
// rustc: | |
use core::marker::PhantomData; | |
use core::mem::{ManuallyDrop, MaybeUninit}; | |
use core::ops::{Deref, DerefMut}; | |
use core::ptr::{addr_of, addr_of_mut}; | |
#[derive(Copy, Clone, Debug)] | |
enum Kind { | |
Inline, |
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
mod private { | |
pub trait Sealed<A, R> {} | |
} | |
pub trait TupleFn<A, R>: private::Sealed<A, R> { | |
fn as_tuple_fn(self) -> impl FnMut(A) -> R; | |
} | |
macro_rules! impl_tuple_fns { | |
(__emit $($arg:ident),*) => { |
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::{ | |
process::exit, | |
time::{SystemTime, UNIX_EPOCH}, | |
}; | |
use hmac::{Hmac, Mac}; | |
use sha1::Sha1; | |
type HmacSha1 = Hmac<Sha1>; |
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::{ | |
cell::UnsafeCell, | |
panic::{self, AssertUnwindSafe}, | |
sync::atomic::{AtomicBool, AtomicPtr, Ordering}, | |
thread::{self, Thread}, | |
unreachable, | |
}; | |
use sptr::Strict; |
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 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 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 ()) { |
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
--- 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 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 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 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") { |
NewerOlder