This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config :opentelemetry, :processors, | |
ot_batch_processor: %{ | |
exporter: { | |
:opentelemetry_exporter, | |
%{ | |
protocol: :grpc, | |
endpoints: [ | |
{:http, "localhost", 55680, []}, | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use downcast_rs::{impl_downcast, Downcast}; | |
trait Command: Downcast { | |
fn execute(&self); | |
} | |
impl_downcast!(Command); | |
#[derive(Debug, PartialEq)] | |
enum Temperature { | |
Hot, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM rust_base:latest | |
COPY src/ . | |
RUN cargo build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(use_extern_macros)] | |
extern crate thunder; | |
extern crate clap; | |
use thunder::thunderclap; | |
struct Wrapper; | |
#[thunderclap] | |
impl Wrapper { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "cli-example" | |
version = "0.1.0" | |
authors = ["Gustavo Aguiar"] | |
[dependencies] | |
thunder = { git = "https://github.com/spacekookie/thunder", rev = "65bf4bc" } | |
clap = "2.32" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]` |
NewerOlder