Skip to content

Instantly share code, notes, and snippets.

Friedel Ziegelmayer dignifiedquire

  • Germany
Block or report user

Report or block dignifiedquire

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View main.rs
use async_imap::{connect, error::Result};
use async_std::prelude::*;
use async_std::task;
use async_tls::TlsConnector;
use std::time::Duration;
fn main() -> Result<()> {
task::block_on(async {
let server = "imap.server.com";
View path.rs
async fn compare_path(&self, path_files: Vec<File>) -> Vec<File> {
let changed_files = Vec::with_capacity(path_files.len());
let changed_files = Arc::new(Mutex::new(changed_files));
let mut handles = Vec::with_capacity(path_files.len());
// Check all files
for file in path_files {
let changed_files = Arc::clone(&changed_files);
View license.txt
MIT: tokio-sync, tokio-timer, tokio-executor, kernel32-sys, string, tokio, winutil, generic-array, tokio-tcp, argon2rs, try-lock, rustyline, redox_syscall, slab, phf_shared, tokio-threadpool, h2, http-body, try_from, unsafe-any, openssl-sys, darling_macro, libsqlite3-sys, memoffset, rusqlite, circular, nix, strum_macros, lettre, synstructure, strsim, tokio-current-thread, darling, tokio-io, darling_core, miniz_oxide_c_api, ws2_32-sys, schannel, nom, winapi, bytes, phf, r2d2_sqlite, want, void, tokio-buf, winreg, unicase, hostname, owning_ref, hyper, matches, mime_guess, redox_users, scoped_threadpool, strum, tokio-reactor, miniz_oxide, enum_primitive, mio
BSD-2-Clause: cloudabi, mach
BSD-3-Clause: ed25519-dalek, x25519-dalek, fuchsia-zircon, fuchsia-zircon-sys, subtle, curve25519-dalek
Apache-2.0: openssl
MPL-2.0: ascii_utils, fast_chemail
BSD-3-Clause AND Zlib: adler32
CC0-1.0: constant_time_eq, keccak
ISC: rdrand
MPL: deltachat
License specified in file (/Users/dignifiedquire/.cargo/registry/src/github.com-
View log.txt
$ cargo fix --edition
Checking pgp v0.1.0 (/Users/dignifiedquire/opensource/rpgp)
warning: failed to automatically apply fixes suggested by rustc to crate `pgp`
after fixes were automatically applied the compiler reported errors within these files:
* src/composed/shared.rs
* src/composed/signed_key/key_parser_macros.rs
View num-benchmarks.md

benches with u32 digits

running 43 tests
test divide_0          ... bench:         876 ns/iter (+/- 73)
test divide_1          ... bench:      13,661 ns/iter (+/- 2,020)
test divide_2          ... bench:     697,781 ns/iter (+/- 239,589)
test fac_to_string     ... bench:       1,048 ns/iter (+/- 133)
test factorial_100     ... bench:       8,093 ns/iter (+/- 2,855)
test fib2_100          ... bench:       2,150 ns/iter (+/- 503)
View gist:db2f8dc1185cb560e88ca471144cb1b0
ipfs daemon
Initializing daemon...
Swarm listening on /ip4/10.8.0.18/tcp/4001
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/192.168.0.38/tcp/4001
Swarm listening on /ip4/34.202.193.223/tcp/1027
Swarm listening on /ip6/2a02:8071:b689:2000:4ea:b2c:43a3:dc93/tcp/4001
Swarm listening on /ip6/2a02:8071:b689:2000:5d67:6d90:8956:99d8/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
View elcid.js
const multihashing = require('multihashing-async')
const CID = require('cids')
const mh = require('multihashing')
// data - Buffer or string, the data to encode
// hashtype - string
// codec - string, 'dag-pb' or 'dag-cbor', one
// callback - called with (Error, CID) depending on the result
function elcidEncode (data, hashtype, codec, callback) {
if (typeof data === 'string') {
View peerinfo.js
// torn between addr, multiaddr, multiaddress and address
// multi<> seems not needed as we only ever talk about multiaddresses so I feel that is superflous in this context
// Manage multiaddrs
// TODO: do we want ttl handling now?
class MultiaddrSet {
constructor (addrs) {}
get length () {}
View log.txt
DEBUG=libp2p* node_modules/mocha/bin/mocha --timeout 50000 test/index.spec.js
DHT
libp2p:swarm:dialer create: 8 peer limit, 10000 dial timeout +0ms
libp2p:swarm:transport adding TCP +6ms
libp2p:tcp:listen Listening on 9990 127.0.0.1 +6ms
libp2p:swarm:dialer create: 8 peer limit, 10000 dial timeout +3ms
libp2p:swarm:transport adding TCP +1ms
libp2p:tcp:listen Listening on 9991 127.0.0.1 +1ms
View gx-slow
./bin/gx --verbose install
installing package: go-ipfs-0.4.6-dev
[1 / 49] fetched dep: goprocess
[2 / 49] fetched dep: go-log
[3 / 49] fetched dep: go-libp2p-crypto
[4 / 49] fetched dep: semver
[5 / 49] fetched dep: go-libp2p-peer
[6 / 49] fetched dep: bbloom
[7 / 49] fetched dep: go-libp2p-secio
[8 / 49] fetched dep: base32
You can’t perform that action at this time.