Skip to content

Instantly share code, notes, and snippets.

@Fyko
Fyko / extractor.rs
Last active April 23, 2024 10:26
a clerk webhook verifier for axum
///! An [axum](https://docs.rs/axum) extractor for [Clerk webhooks](https://clerk.com/docs/integration/webhooks).
use axum::{
body::Bytes,
extract::FromRequest,
http::{Request, StatusCode},
response::{IntoResponse, Response},
};
// TODO: replace with your config
use happycamper_util::config::CONFIG;
use serde::{Deserialize, Serialize};
@jeremychone
jeremychone / rust-xp-01-s3.rs
Last active May 10, 2024 02:12
Rust Quick Example to connect to S3 and Minio bucket server
#![allow(unused)] // silence unused warnings while exploring (to comment out)
use std::{error::Error, str};
use s3::bucket::Bucket;
use s3::creds::Credentials;
use s3::region::Region;
use s3::BucketConfiguration;
// Youtube Walkthrough - https://youtu.be/uQKBW8ZgYB8
@ityonemo
ityonemo / test.md
Last active June 6, 2024 06:04
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@tstellanova
tstellanova / state_of_rust_fc_2020.md
Last active August 5, 2020 15:43
Current State of Embedded Rust for Flight Controllers

Introduction

A wide variety of widely-available flight controllers and associated robotics boards have been released in the past five years. These boards incorporate a careful selection of sensors and actuator outputs useful for robotics-- not just for flying vehicles, but also rovers and underwater vehicles. This living document analyzes briefly the compatibility of embedded Rust with these inexpensive and powerful boards.

Overall Utility Issues

General issues that impact the usefulness of embedded Rust with these kinds of boards:

  • No (or fragmented) DMA support. Some embedded HAL crates have DMA support already, but many do not. Almost none of the DMA APIs resemble each other. There is at least one effort underway to unify the DMA APIs
@dcchut
dcchut / Example-async.rs
Last active December 16, 2020 12:25
Async version of serde_postgres
#![feature(async_await)]
/*
Cargo.toml dependencies:
serde = { version = "1.0", features = ["derive"] }
tokio = { git = "https://github.com/tokio-rs/tokio", default-features = false, features = ["io", "codec"] }
tokio-postgres = { git = "https://github.com/sfackler/rust-postgres", branch = "std-futures" }
futures-preview = { git = "https://github.com/rust-lang-nursery/futures-rs" , features = ["nightly", "async-await"] }
futures-util-preview = { version = "0.3.0-alpha.4", features = ["compat"] }
@dcchut
dcchut / Example.rs
Created August 4, 2019 16:19
serde_postgres example
use postgres::{Connection, TlsMode};
use std::error::Error;
use serde::Deserialize;
#[derive(Clone, Debug, Deserialize)]
struct Person {
name : String,
data : Vec<u8>,
}
@sibelius
sibelius / learning.md
Last active August 23, 2023 13:21
Learning Path React Native

Basics

  • Learn how to start a new react native project
  • Run it on ios simulator, on android emulator, on a real iPhone device and on a real Android device, with and without debugging enabled.
  • Learn how to upgrade a react native project
  • Learn how to add a package to the project
  • Learn how to add a package that has a native dependency (https://github.com/airbnb/react-native-maps, https://github.com/evollu/react-native-fcm) - DO NOT USE COCOAPODS
  • Learn how to use fetch to get data from your backend

Learn Navigation

@koenbok
koenbok / advanced.md
Last active May 5, 2019 14:34
Learn Programming

Advanced Programming

Programming setup

  • Instant visual output.
  • Fast startup time, fast execution.
  • Sensible errors, with code locations.
  • Easy to set up and get working.

Architecture

Git Cheat Sheet

Commands

Getting Started

git init

or

@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet