Skip to content

Instantly share code, notes, and snippets.

[Running cargo test -p glean-preview --test schema]
Compiling glean-preview v0.0.5 (/Users/jrediger/mozilla/src/glean.rs/glean-core/preview)
Finished test [unoptimized + debuginfo] target(s) in 2.25s
Running target/debug/deps/schema-486af64b29843148
running 1 test
test validate_against_schema ... FAILED
failures:
fn main() {
bind("a", |a| {
println!("{}", a)
});
bind(("a", "b"), |(a, b)| {
println!("{} {}", a, b)
});
/*
error[E0308]: mismatched types
--> src/main.rs:12:48
|
12 | let mut goal = bind(("x", "y", "z"), move |(x, y)| {
| ^^^^^^ expected a tuple with 3 elements, found one with 2 elements
|
= note: expected tuple `(Variable, Variable, Variable)`
found tuple `(_, _)`
use async_std::task;
fn main() -> redis::RedisResult<()> {
task::block_on(async {
let client = redis::Client::open("redis://127.0.0.1/")?;
let mut con = client.get_async_connection().await?;
redis::cmd("SET")
.arg("rust")
.arg("async")
use std::env;
use once_cell::sync::Lazy;
use tempfile::Builder;
use glean_preview::{Glean, Configuration, Error, metrics::PingType};
#[allow(non_upper_case_globals)]
pub static PrototypePing: Lazy<PingType> = Lazy::new(|| {
PingType::new("prototype", true)
@badboy
badboy / counter.rs
Last active November 20, 2019 11:28
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
use std::ffi::CString;
use std::os::raw::c_char;
/// A counter metric.
///
/// Used to count things.
#chat .channel .message.highlight {
border-left: 5px solid #4d4332; /* it notches inwards slightly on highlights unless we do this */
}
/* make actions look more like IRCCloud */
#chat .action .content {
font-style: italic;
}
#chat .action .from::before {
@badboy
badboy / glean.py
Last active October 21, 2019 13:22
#!/usr/bin/env python
# encoding: utf-8
from cffi import FFI
import weakref
global_weakkeydict = weakref.WeakKeyDictionary()
ffi = FFI()
ffi.cdef("""
diff --git app/build.gradle app/build.gradle
index 468f18a2..55b70232 100644
--- app/build.gradle
+++ app/build.gradle
@@ -266,11 +266,7 @@ android.applicationVariants.all { variant ->
buildConfigField 'boolean', 'CRASH_REPORTING', 'false'
}
- if (!isDebug) {
buildConfigField 'boolean', 'TELEMETRY', 'true'
diff --git build.gradle build.gradle
index dd77e6b47..4f8e9661a 100644
--- build.gradle
+++ build.gradle
@@ -26,6 +26,7 @@ allprojects {
repositories {
google()
jcenter()
+ mavenLocal()