Skip to content

Instantly share code, notes, and snippets.

config :opentelemetry, :processors,
ot_batch_processor: %{
exporter: {
:opentelemetry_exporter,
%{
protocol: :grpc,
endpoints: [
{:http, "localhost", 55680, []},
]
}
# select build image
FROM rustlang/rust:nightly
# create a new empty shell project
RUN USER=root cargo new --lib ww_subscription
WORKDIR /ww_subscription
# copy over your manifests
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
// https://usehooks.com/useOnClickOutside/
export function useOnClickOutside(ref, handler) {
useEffect(
() => {
let touchendTimeout = null;
const listener = event => {
touchendTimeout = null;
// If user clicks inside the element, return
if (!ref.current || ref.current.contains(event.target)) {
return;
use downcast_rs::{impl_downcast, Downcast};
trait Command: Downcast {
fn execute(&self);
}
impl_downcast!(Command);
#[derive(Debug, PartialEq)]
enum Temperature {
Hot,
# The version of Alpine to use for the final image
# This should match the version of Alpine that the `elixir:1.7.2-alpine` image uses
ARG ALPINE_VERSION=3.8
FROM elixir:1.7.2-alpine AS builder
# The following are build arguments used to change variable parts of the image.
# The name of your application/release (required)
ARG APP_NAME
# The version of the application we are building (required)
FROM rust_base:latest
COPY src/ .
RUN cargo build
#![feature(prelude_import)]
#![no_std]
#![feature(use_extern_macros)]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std;
extern crate thunder;
extern crate clap;
#![feature(use_extern_macros)]
extern crate thunder;
extern crate clap;
use thunder::thunderclap;
struct Wrapper;
#[thunderclap]
impl Wrapper {
[package]
name = "cli-example"
version = "0.1.0"
authors = ["Gustavo Aguiar"]
[dependencies]
thunder = { git = "https://github.com/spacekookie/thunder", rev = "65bf4bc" }
clap = "2.32"
Compiling thunder v0.3.1 (file:///home/gustavo.aguiar/git/gugahoa/thunder)
warning: this feature has been stable since 1.29.0. Attribute no longer needed: thunder
--> src/lib.rs:4:12
|
4 | #![feature(proc_macro, proc_macro_lib, iterator_flatten)]
| ^^^^^^^^^^
|
= note: #[warn(stable_features)] on by default
warning: proc macro crates and `#[no_link]` crates have no effect without `#[macro_use]`