Shuttle.rs Christmas Code Hunt 2023

Overview

🚀 Shuttle.rs Christmas Code Hunt 2023 Submissions 🎄

These are my submissions for the Christmas Code Hunt hosted by shuttle.rs

This is using a custom service (even though it's a tad unnecessary) to wrap around an Axum runtime.

Live host is available at https://console.shuttle.rs/project/cch23-razzdrgn (NOTE: HAS NOT BEEN UPDATED SINCE DEC 01 DUE TO SERVICE DISRUPTIONS)

Day 0 (Implemented Nov 30, 2023)

Returns 200 and a fun xmas message at the root endpoint. Returns 500 and a silly boonus message at the /-1 endpoint

Day 1 (Implemented Dec 01, 2023)

Decodes path from the /1 endpoint onwards and performs a Bitwise XOR operation on the numbers provided, or on 0 if the parsing fails. After the Bitwise XOR, raises the result to the power of 3 and then returns the result along with status 200.

Day 4 (Implemented Dec 04, 2023)

Takes POST requests containing a JSON array of Reindeer objects. At the endpoint /4/strength returns the sum total of the "strength" attributes. At the endpoint /4/contest, performs some comparisons on the properties of the objects, then returns user-readable output containing stats about the inputs. Namely, the reindeer with the highest "speed", "height", "snow_magic_power", and "candies_eaten_yesterday" attributes.

Day 6 (Implemented Dec 06, 2023)

Takes a POST request containing plaintext, and returns a JSON object containing the counts of the occurances of "elf", "elf on a shelf", and "shelf" (without "elf on a " preceding it).

Day 7 (Implemented Dec 07, 2023)

Endpoint /7/decode analyzes the Cookie header, and decodes the "recipe" field from base64 into a JSON object. Endpoint /7/bake takes in said recipe JSON objects (with properties "recipe" and "pantry"), then tries to "bake" the cookies. For the process to work, the Recipe's components must all exist in the Pantry, and the Pantry must contain equal to or greater than the number of materials required by the recipe.

Day 8 (Implemented Dec 08, 2023)

Endpoint /8/weight will take a pokedex number from the path (i.e. GET .../8/weight/150 for Mewtwo) and return the Pokemon's weight in Kg as plaintext. Endpoint /8/drop will take the same parameters and return the impact momentum from a 10 foot freefall, returned as N*s in plaintext.

Day 10

No challenge today, but went through and tried fixing things to work with the unofficial codehunt.rs leaderboard. Big things are just, better usage of serde across the board, and a few minor logic fixes, but no major changes, just fixing json fields. My stuff still isn't working with their API though because:

  1. ngrok keeps giving me network errors
  2. when the data does arrive it arrives corrupted

I've manually checked all of the results by hand and like. My code's working. There's just something Going On that I'm not sure what it is. I'm hoping to work with the guy who's running it at some point to figure out what it is so here's hoping.

You might also like...
Dynamically invoke arbitrary unmanaged code.

DInvoke_rs Rust port of Dinvoke. DInvoke_rs may be used for many purposes such as PE parsing, dynamic exported functions resolution, dynamically loadi

Easy to use Rust i18n library based on code generation

rosetta-i18n rosetta-i18n is an easy-to-use and opinionated Rust internationalization (i18n) library powered by code generation. rosetta_i18n::include

A document-code sync tools for document engineering.

Writing A document-code sync tools for document engineering. Writing 是一个自动 “文档-代码” 同步工具。解析 Markdown 中的代码定义,读取目标代码,并嵌入到新的文档中。 Language parse support by

Clean up the lines of files in your code repository

lineman Clean up the lines of files in your code repository NOTE: While lineman does have tests in place to ensure it operates in a specific way, I st

A simple code boilerplate generator written in Rust.

💻 Cgen What is Cgen? A modern, cross-platform, multi-language boilerplate generator aimed to make your code generation less hectic! If you wish to su

Experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code

Diplomat is an experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code. With Diplomat, you can simply define Rust APIs to be exposed over FFI and get high-level C, C++, and JavaScript bindings automatically!

A code coverage tool for Rust projects

Tarpaulin Tarpaulin is a code coverage reporting tool for the Cargo build system, named for a waterproof cloth used to cover cargo on a ship. Currentl

My solutions to the Advent of Code 2020.

AdventofCode2021 My solutions to the advent of code event 2021. For this edition I chose to solve the puzzles using Rust 🦀 . Day Name Link Solution 1

My solutions to the advent of code 2021 problems.

Advent of Code 2021 My solutions to the AOC 2021 problems in Rust. Solutions Task Status Day 1 ✔️ , ✔️ Day 2 ✔️ , ✔️ Day 3 ✔️ , ✔️ Day 4 ✔️ , ✔️ Day 5

Owner
null
🚫📆 Serverless calendar built with shuttle.rs

zerocal ?? ?? Welcome to zerocal, the serverless calendar. It allows you to create calendar invites from the convenience of your terminal! ?? Here's m

Matthias 150 Jan 2, 2023
Migrate C code to Rust

C2Rust helps you migrate C99-compliant code to Rust. The translator (or transpiler) produces unsafe Rust code that closely mirrors the input C code. T

Immunant 3k Jan 8, 2023
Mix async code with CPU-heavy thread pools using Tokio + Rayon

tokio-rayon Mix async code with CPU-heavy thread pools using Tokio + Rayon Resources Documentation crates.io TL;DR Sometimes, you're doing async stuff

Andy Barron 74 Jan 2, 2023
Minimal, flexible framework for implementing solutions to Advent of Code in Rust

This is advent_of_code_traits, a minimal, flexible framework for implementing solutions to Advent of Code in Rust.

David 8 Apr 17, 2022
Waits until the exit code of a program is zero

Waitz A rust utility to wait that a program exits with 0. You need to wait for something to start up and don't know when it finishes?

Max Strübing 15 Apr 10, 2022
Sample code for compute shader 101 training

Sample code for Compute Shader 101 This repo contains sample code to help you get started writing applications using compute shaders.

Google Fonts 332 Jan 1, 2023
Detect if code is running inside a virtual machine (x86 and x86-64 only).

inside-vm Detect if code is running inside a virtual machine. Only works on x86 and x86-64. How does it work Measure average cpu cycles when calling c

null 34 Oct 3, 2022
Doku is a framework for building documentation with code-as-data methodology in mind.

Doku is a framework for building documentation with code-as-data methodology in mind. Say goodbye to stale, hand-written documentation - with D

ANIXE 73 Nov 28, 2022
A tool to run web applications on AWS Lambda without changing code.

AWS Lambda Adapter A tool to run web applications on AWS Lambda without changing code. How does it work? AWS Lambda Adapter supports AWS Lambda functi

AWS Samples 321 Jan 2, 2023
Simplified glue code generation for Deno FFI libraries written in Rust.

deno_bindgen This tool aims to simplify glue code generation for Deno FFI libraries written in Rust. Quickstart # install CLI deno install -Afq -n den

Divy Srivastava 173 Dec 17, 2022