Skip to content

Instantly share code, notes, and snippets.

@ArtemGr
ArtemGr / main.rs
Created November 21, 2023 02:47
bit get set
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);
}
@ArtemGr
ArtemGr / main.rs
Last active July 9, 2023 19:49
serde f16 73871891
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,
@ArtemGr
ArtemGr / .gitignore
Last active February 28, 2022 15:10
extract repositories and code from CodeSearchNet
# CodeSearchNet
/python*.jsonl
/python*.jsonl.gz
/python.zip
/code.txt
/repos.txt
@ArtemGr
ArtemGr / .gitignore
Last active February 6, 2022 11:24 — forked from mfelsche/sled_experiment.rs
Rocksdb experiment, watching consumed disk space
/target
/db
/Cargo.lock
@ArtemGr
ArtemGr / .gitignore
Last active November 2, 2022 10:59
llog
/__pycache__
/llog
@ArtemGr
ArtemGr / certbot.js
Last active October 4, 2021 08:31
certbot
//@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:
@ArtemGr
ArtemGr / .gitignore
Last active March 20, 2021 06:30
termkit-pause
/node_modules
/package-lock.json
@ArtemGr
ArtemGr / index.js
Last active May 17, 2023 05:18
llog.js
// 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
@ArtemGr
ArtemGr / mac-port-forwarding-fails.txt
Created February 17, 2020 21:55
mac-port-forwarding-fails.txt
administrator@macinvalut:~$ docker stop komodo-dex
komodo-dex
administrator@macinvalut:~$ docker run -d --rm -p 14868:14868 -p 14869:14869 --name komodo-dex komodo-dex
479ca54e6d7c2a6d53cab4823b47c44ba5bd1cb712cfd4bed8b5cb79cccf96e6
administrator@macinvalut:~$ docker logs komodo-dex
ASSETCHAINS_SUPPLY 999999
MAX_MONEY 100006220417438 1000062.20417438
>>>>>>>>>> DEXP2P: p2p.14868 rpc.14869 magic.6378a12f 1668849967 999999 coins
call komodo_args.(komodod) NOTARY_PUBKEY.()
nMaxConnections 384
@ArtemGr
ArtemGr / keybase.md
Created February 13, 2020 08:56
keybase.md

Keybase proof

I hereby claim:

  • I am artemgr on github.
  • I am artemciy (https://keybase.io/artemciy) on keybase.
  • I have a public key ASCUwRz1jGzzJ5ZZsUS6-rRSQSqBmYnZ77If1bdOyBWnfAo

To claim this, I am signing this object: