Skip to content

Instantly share code, notes, and snippets.

Avatar

Ted Mielczarek luser

View GitHub Profile
@luser
luser / idle.rs
Created Apr 29, 2020
idle_timeout_reset
View idle.rs
/// Create a `Future` that will resolve after `idle_period` has elapsed, along with an `IdleReset` that can be used to reset the time period or cancel the timeout.
///
/// This can be used to trigger an event that should happen after a period of inactivity. Activity in this situation is indicated by calling
/// `idle_reset` on the returned `IdleReset`. The timeout can be cancelled by calling `cancel` on the `IdleReset`.
///
/// Returns a tuple of (`IdleReset`, `Future`)
pub fn idle_timeout_reset(
idle_period: Duration,
) -> (IdleReset, impl Future<Output = bool> + Send + 'static) {
// ...
View moco-group-april-2007.exif
ExifTool Version Number : 11.65
File Name : moco-group-april-2007.jpg
Directory : /mnt/photos
File Size : 3.0 MB
File Modification Date/Time : 2008:02:21 08:50:50-05:00
File Access Date/Time : 2008:02:21 08:50:50-05:00
File Inode Change Date/Time : 2008:02:21 08:50:50-05:00
File Permissions : rwxr-xr-x
File Type : JPEG
File Type Extension : jpg
View Image2Map.py
# Filename : Image2Map.py
# Authors : Georg Muntingh and Bjorn Lindeijer
# Version : 1.2
# Date : June 16, 2010
# Copyright : Public Domain
import os, sys, networkx
from PIL import Image
class TileMap:
View README.md

Firefox committers touching Rust code

  1. Clone the mozilla-central Mercurial repository:

    hg clone https://hg.mozilla.org/mozilla-central

  2. Clone the version-control-tools repository:

    hg clone https://hg.mozilla.org/hgcustom/version-control-tools/

  3. Enable the mozext and firefoxtree extensions in .hgrc:

View README.md

Sample sccache logs

These are logs from using sccache as a compiler wrapper to build this simple Rust crate.

sccache-env-logger.log was produced from the master branch of sccache, while sccache-tokio-trace.log was produced from the tokio-trace branch.

The logs were produced by running these commands:

git clone https://github.com/luser/snippet
View sccache-env-logger-plain.log
TRACE 2019-02-26T13:56:45Z: sccache::cmdline: parse
DEBUG 2019-02-26T13:56:45Z: sccache::config: Attempting to read config file at "/Users/luser/Library/Preferences/Mozilla.sccache/config"
DEBUG 2019-02-26T13:56:45Z: sccache::config: Couldn't open config file: No such file or directory (os error 2)
TRACE 2019-02-26T13:56:45Z: sccache::commands: Command::InternalStartServer
INFO 2019-02-26T13:56:45Z: sccache::server: start_server: port: 4226
INFO 2019-02-26T13:56:45Z: sccache::cache::cache: No configured caches successful, falling back to default
TRACE 2019-02-26T13:56:45Z: sccache::cache::cache: Using DiskCache("/Users/luser/Library/Caches/Mozilla.sccache", 10737418240)
INFO 2019-02-26T13:56:45Z: sccache::server: server started, listening on port 4226
TRACE 2019-02-26T13:56:51Z: sccache::server: incoming connection
TRACE 2019-02-26T13:56:51Z: sccache::server: handle_client
View sccache.log
Finished dev [unoptimized + debuginfo] target(s) in 0.29s
Running `target/debug/sccache`
TRACE sccache::cmdline: parse
DEBUG sccache::config: Attempting to read config file at "/Users/luser/Library/Preferences/Mozilla.sccache/config"
DEBUG sccache::config: Couldn't open config file: No such file or directory (os error 2)
TRACE sccache::commands: Command::InternalStartServer
INFO sccache::server: start_server: port: 4226
INFO sccache::cache::cache: No configured caches successful, falling back to default
TRACE sccache::cache::cache: Using DiskCache("/Users/luser/Library/Caches/Mozilla.sccache", 10737418240)
INFO sccache::server: server started, listening on port 4226
View sccache.log
TRACE sccache::cmdline: parse
DEBUG sccache::config: Attempting to read config file at "/Users/luser/Library/Preferences/Mozilla.sccache/config"
DEBUG sccache::config: Couldn't open config file: No such file or directory (os error 2)
TRACE sccache::commands: Command::InternalStartServer
INFO sccache::server: start_server: port: 4226
INFO sccache::cache::cache: No configured caches successful, falling back to default
TRACE sccache::cache::cache: Using DiskCache("/Users/luser/Library/Caches/Mozilla.sccache", 10737418240)
INFO sccache::server: server started, listening on port 4226
TRACE sccache::server: incoming connection
DEBUG handle_client{id=0}: sccache::server: handle_client: compile
View lldb_symbols.py
#!/usr/bin/env python
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
import lldb
import gzip
import io
import itertools
import os
import shutil
View expensive-compiles
26.120 Unified_cpp_editor_libeditor1.o
26.517 Unified_cpp_dom_ipc1.o
26.704 Unified_cpp_gfx_skia24.o
26.743 Unified_cpp_dom_canvas0.o
26.907 Unified_cpp_image_test_gtest0.o
26.935 UnifiedBindings11.o
27.325 audioipc_client
27.375 Unified_cpp_dom_ipc0.o
27.456 Unified_cpp_src_peerconnection0.o
27.496 UnifiedBindings4.o
You can’t perform that action at this time.