Skip to content

Instantly share code, notes, and snippets.

@scrogson
scrogson / basic.rs
Last active November 27, 2023 15:52
mod workers {
use ishikari::prelude::*;
use serde::{Deserialize, Serialize};
use tracing::info;
#[derive(Clone, Debug, Deserialize, Serialize)]
#[ishikari::job]
pub struct Sum {
pub a: i32,
pub b: i32,
version: "3"
networks:
devbox:
external: true
volumes:
rabbitmq:
external: true
postgres:
@scrogson
scrogson / playground.rs
Created May 16, 2020 21:13 — forked from anonymous/playground.rs
Shared via Rust Playground
#[macro_use]
extern crate hyper;
extern crate reqwest;
use reqwest;
use std::io::Read;
header! { (ContentType, "Content-Type") => [String] }
header! { (ContentLength, "Content-Length") => [usize] }
FROM node:12.2-slim as assets
WORKDIR /app/assets
COPY assets/package*.json ./
RUN npm install
# Copy the entire app so we can put files into /app/priv/static
COPY . /app
use std::future::Future;
use tokio::runtime::{Builder, Runtime};
use tokio::task::JoinHandle;
lazy_static::lazy_static! {
static ref TOKIO: Runtime = Builder::new()
.threaded_scheduler()
.build()
.expect("Franz.Native: Failed to start tokio runtime");
}
@scrogson
scrogson / after.valgrind.log
Last active December 11, 2019 05:49
Rustler Segfault - OwnedEnv::send_and_clear
==14241== Memcheck, a memory error detector
==14241== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==14241== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==14241== Command: /home/scrogson/otp/bin/x86_64-unknown-linux-gnu/beam.valgrind.smp -S 8:8 -SDcpu 8:8 -- -root /home/scrogson/otp -progname /home/scrogson/otp/bin/cerl\ -valgrind -- -home /home/scrogson -- -kernel shell_history enabled -- --track-origins=yes -kernel shell_history enabled -pa /usr/local/lib/elixir/bin/../lib/eex/ebin /usr/local/lib/elixir/bin/../lib/elixir/ebin /usr/local/lib/elixir/bin/../lib/ex_unit/ebin /usr/local/lib/elixir/bin/../lib/iex/ebin /usr/local/lib/elixir/bin/../lib/logger/ebin /usr/local/lib/elixir/bin/../lib/mix/ebin -elixir ansi_enabled true -noshell -s elixir start_cli -- -- -extra /usr/local/bin/mix test
==14241==
==14241== Warning: set address range perms: large range [0x643d000, 0x4643d000) (noaccess)
warning: variable "i" is unused (if the variable is not meant to be us
# generated code, do not edit!
#ApiKey: Produce, 0
ProduceRequestV0 => acks timeout [topic_data]
acks => INT16
timeout => INT32
topic_data => topic [data]
topic => STRING
data => partition record_set
partition => INT32

Keybase proof

I hereby claim:

  • I am scrogson on github.
  • I am scrogson (https://keybase.io/scrogson) on keybase.
  • I have a public key ASDCQthqJvMSr2oa_EFbEiJAcnQmuQZuW1sGh80eE3jzVwo

To claim this, I am signing this object:

@scrogson
scrogson / beam_opcodes.erl
Created July 12, 2017 15:28
BEAM OpCodes
-module(beam_opcodes).
%% Warning: Do not edit this file.
%% Auto-generated by 'beam_makeops'.
-export([format_number/0]).
-export([opcode/2,opname/1]).
-spec format_number() -> 0.
format_number() -> 0.