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(maybe_uninit_as_bytes)] // https://github.com/rust-lang/rust/issues/93092 | |
#![feature(maybe_uninit_slice)] | |
use std::hint::black_box; | |
use std::mem::MaybeUninit; | |
#[unsafe(no_mangle)] pub extern "C" fn maybe0() -> bool { | |
let str: MaybeUninit<String> = MaybeUninit::zeroed(); | |
unsafe {str.as_bytes().assume_init_ref()} .iter().all (|&b| b == 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
// fomat-macros = "0.3" | |
// gstuff = {version = "^0.8.20", features = ["crossterm", "fomat-macros", "inlinable_string", "nightly", "re"]} | |
// scopeguard = "1" | |
// winapi = {version = "0.3", features = ["wlanapi"]} | |
#![allow(non_snake_case)] | |
#![allow(uncommon_codepoints)] | |
use fomat_macros::fomat; | |
use gstuff::{fail, log}; | |
use gstuff::re::Re; | |
use std::mem::MaybeUninit; |
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 fn main() { | |
let mut hot = 0u128; | |
for ix in [0, 127] {hot |= 1 << ix} | |
println! ("{:b}", hot); | |
assert! (hot & (1 << 0) != 0); | |
assert! (hot & (1 << 126) == 0); | |
assert! (hot & (1 << 127) != 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
extern crate half; // 2.3.1 | |
extern crate serde; // 1.0.164 | |
extern crate serde_json; // 1.0.99 | |
use half::f16; | |
use serde::{Deserialize, Deserializer, Serialize, Serializer}; | |
fn f16ser<S>(fv: &f16, se: S) -> Result<S::Ok, S::Error> | |
where | |
S: Serializer, |
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
# CodeSearchNet | |
/python*.jsonl | |
/python*.jsonl.gz | |
/python.zip | |
/code.txt | |
/repos.txt |
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
/target | |
/db | |
/Cargo.lock |
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
/__pycache__ | |
/llog |
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
//@ts-check | |
// TODO: A function to run the `certbot`; arguments: domain, email | |
const fs = require ('fs'); | |
const http = require ('http'); | |
const os = require ('os'); | |
/** | |
* Example invoking certbot for this function, on Debian 10 Buster: |
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
/node_modules | |
/package-lock.json |
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
// To add this Gist to a project: | |
// | |
// npm install https://gist.github.com/25fad725870b0ada74df2bce7d115cc1.git | |
/** | |
* @param {number} level | |
*/ | |
exports.trace = function (level) { | |
const obj = {} | |
const lim = Error.stackTraceLimit |
NewerOlder