Skip to content

Instantly share code, notes, and snippets.

@aphyr
aphyr / gist:6266347
Last active December 21, 2015 06:48
In this ZK demo, a partition places the primary on the minority component. All
operations time out while the cluster converges on a new primary, at which
point three clients (talking to the three nodes in the majority component) can
proceed again. When the partition is healed, the two minority nodes can begin
accepting writes again. As with single-node Postgres, Zookeeper's client
protocol and ZAB both allow for false negatives (timeouts may actually succeed)
but not false positives (every successful write *will* be present in the final
set.)
HOW TO READ THIS CHART:
@wsargent
wsargent / docker_cheat.md
Last active August 2, 2025 19:24
Docker cheat sheet

Git Cheat Sheet

Commands

Getting Started

git init

or

@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

@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

@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>,
}
@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"] }
@tstellanova
tstellanova / state_of_rust_fc_2020.md
Last active May 28, 2025 05:03
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
@ityonemo
ityonemo / test.md
Last active July 24, 2025 22:32
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)

@jeremychone
jeremychone / rust-xp-01-s3.rs
Last active October 11, 2024 13:18
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