Skip to content

Instantly share code, notes, and snippets.

use std::char::{decode_utf16, DecodeUtf16Error};
#[allow(non_camel_case_types)]
pub struct wstr([u16]);
impl wstr {
pub fn to_wstring(&self) -> WString {
self.to_owned()
}
In file included from /build/mcpelauncher/fake-jni/examples/src/main.cpp:3:
In file included from /build/mcpelauncher/fake-jni/include/fake-jni/jvm.h:5:
/build/mcpelauncher/fake-jni/include/fake-jni/internal/meta/field.h:61:73: error: conversion from 'FakeJni::JString' to 'jvalue' is ambiguous
((T*)inst)->*((type_t)field) = ValueTranslator<F>::convert_set(env, *((F*)value));
^~~~~~~~~~~~
/build/mcpelauncher/fake-jni/include/fake-jni/jvm.h:1465:59: note: in instantiation of member function 'FakeJni::_CX::FieldAccessor<FakeJni::JString ExampleClass::*>::set' requested here
proxySetFunc((void (*)())&_CX::FieldAccessor<T (M::*)>::set),
^
/build/mcpelauncher/fake-jni/include/fake-jni/jvm.h:1386:38: note: in instantiation of function template specialization 'FakeJni::JFieldID::JFieldID<FakeJni::JString, ExampleClass>' requested here
return clazz->registerField(new JFieldID(fie
This file has been truncated, but you can view the full file.
#![feature(prelude_import)]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std;
pub use bevy_hecs::{Query as HecsQuery, *};
mod resource {
mod resource_query {
@luser
luser / idle.rs
Created April 29, 2020 17:22
idle_timeout_reset
/// 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) {
// ...
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
@luser
luser / Image2Map.py
Last active October 24, 2019 18:52 — forked from bjorn/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:

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:

@luser
luser / README.md
Last active February 26, 2019 14:32

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
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
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