Skip to content

Instantly share code, notes, and snippets.

View huanguolin's full-sized avatar

Alvin Huang huanguolin

View GitHub Profile
@etienne-dldc
etienne-dldc / do_not_reproduce_at_home.ts
Last active July 8, 2021 08:42
A calculator made with Typescript type system only, because why not ¯\_(ツ)_/¯
type Bit = 0 | 1;
type Byte = [Bit, Bit, Bit, Bit, Bit, Bit];
type Decimal =
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
| 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19
| 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29
| 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39
| 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49
@rylev
rylev / learn.md
Created March 5, 2019 10:50
How to Learn Rust

Learning Rust

The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.

Warning

Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.

The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.

@ABridoux
ABridoux / WindowPosition.swift
Last active June 3, 2025 08:25
Logic to easily set a NSWindow's origin horizontally and vertically in a screen (AppKit and SwiftUI)
// Free to use
// Written by Alexis Bridoux - https://github.com/ABridoux
import AppKit
#if canImport(SwiftUI)
import SwiftUI
#endif
// MARK: Model