Skip to content

Instantly share code, notes, and snippets.

@njlr
njlr / raleigh-frame-serial-numbering-system.md
Created August 9, 2016 14:34
The numbering system used for Raleigh bicycle frames

For Your Information: Frame Serial Numbering System

The location of our frame serial numbers will be on the top of the seat tube facing to the rear of the bicycle. This does not apply to models with 531 seat tubes which will be numbered under the bottom bracket. Markings show the source of manufacture, approximate date of manufacture and unique number of each frame manufactured in any 10 year cycle.

Size of letters and numbers 3/16" high, to match diameter of tubes. The complete stamp contains nine digits.

FIRST SYMBOL Denotes Location of Manufacture

Symbol | Location

786be73f07f8bf5cc4c26dd0bb4f57e0777671adf256e6d5168a4f0c02f167b6
open System
open System.Globalization
let parseIsoDateTime (s : string) =
let dt = DateTime.Parse(s, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind)
assert (dt.Kind = DateTimeKind.Utc)
dt
let dt = parseIsoDateTime "2023-05-18T15:43:14.673Z"
type Circle<'t when 't : (static member Zero : 't)
and 't : (static member One : 't)
and 't : (static member (+) : 't * 't -> 't)
and 't : (static member (-) : 't * 't -> 't)
and 't : (static member (*) : 't * 't -> 't)
and 't : (static member (/) : 't * 't -> 't)
and 't : (static member (~-) : 't -> 't)
and 't : (static member op_Explicit : float -> 't) > =
{
Radius : 't
@njlr
njlr / Stateful.fs
Created August 31, 2021 20:24
State monad in F#
[<Struct>]
type Stateful<'state, 'result> =
Stateful of ('state -> 'state * 'result)
type Delayed<'state, 'result> = unit -> Stateful<'state, 'result>
module State =
let update f =
Stateful (fun state -> f state, ())
@njlr
njlr / dell-studio-xps-8100-hackintosh.md
Last active March 23, 2021 11:44
Dell Studio XPS 8100 Hackintosh

Dell Studio XPS 8100 Hackintosh Build

Components

  • Dell Motherboard
  • Dell RAM 3x2GB DDR3 SDRAM
  • Intel Core i7 2.93 GHz
  • ASUS NVIDIA 970 GTX
  • Samsung Evo 850 SSD
before_install:
# Install Linuxbrew
- git clone https://github.com/Linuxbrew/brew.git $HOME/.linuxbrew
- PATH="$HOME/.linuxbrew/bin:$PATH"
- echo 'export PATH="$HOME/.linuxbrew/bin:$PATH"' >>~/.bash_profile
- export MANPATH="$(brew --prefix)/share/man:$MANPATH"
- export INFOPATH="$(brew --prefix)/share/info:$INFOPATH"
- brew --version
# Install Buck
- brew tap facebook/fb
Without do-notation With do-notation
Lazy - Haskell
Strict C++ Where the Magic Happens

5 Minutes to Buck

0. What tools will I need?

🚨 This tutorial was written with Linux in mind. Windows and macOS users, please refer to Facebook's setup instructions.

You will need GCC / Clang, a text editor and Buck.

You probably have the first two, so here's how to install Buck for Linux:

Encapsulation in Java ☕

Today we are going to learn about encapsulation using Java!

OK! Let's write a vector class...

public class Vector2 {
    public float x;
 public float y;