Skip to content

Instantly share code, notes, and snippets.

View wongjiahau's full-sized avatar

WJH wongjiahau

  • Malaysia
View GitHub Profile
@graninas
graninas / haskeller_competency_matrix.md
Last active April 25, 2024 20:48
Haskeller competency matrix

Haskeller Competency Matrix

See also List of materials about Software Design in Haskell

Junior Middle Senior Architect
Haskell level Basic Haskell Intermediate Haskell Advanced Haskell Language-agnostic
Haskell knowledge scope Learn you a Haskell Get programming with Haskell Haskell in Depth Knows several languages from different categories
Get programming with Haskell Haskell in Depth Functional Design and Architecture
[Other books on Software Engineering in Haskell](https://github.com/graninas/software-design-in-haskell#B
-- comments
--| doc comments (default markdown)
--| prefix | prefixed comments
--[ block comment
]--
--[ prefix |
prefixed block comment
]--
@jimmychu0807
jimmychu0807 / string-conversion.rs
Created November 21, 2019 10:20
Conversion between String, str, Vec<u8>, Vec<char> in Rust
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte
@DucNgn
DucNgn / PowerlineForTerminal.md
Last active March 29, 2024 03:28
Powerline style for terminal OSX

Installing and configuring Powerline-style command line tools for developers (OSX)

Intro:

For every developer, terminal is their weapon, so why don't you customize it to become a powerful, and a beautiful weapon?

Powerline style refers to a terminal style that helps developer to keep track of their workflow easily, allows them to have perfect visual on current directories and new changes. It is also git recognizable, and failure detector that will help your development process becomes more interact and much faster.

In this guideline, I will introduce you with 2 smart shells: Zsh and Fishshell. Both are perfect for the development jobs due to its rich of resources, and user-friendly.

Note:

@yelouafi
yelouafi / algebraic-effects-series-2.md
Last active April 19, 2023 08:20
Capturing continuations with Generators

Algebraic Effects in JavaScript part 2 - Capturing continuations with Generators

This is the second part of a series about Algebraic Effects and Handlers.

Note: initially I planned a 3-part series, but since the current post on undelimited continuations ended up taking

@yelouafi
yelouafi / algebraic-effects-series-1.md
Last active February 24, 2024 16:03
Operational Introduction to Algebraic Effects and Continuations

Algebraic Effects in JavaScript part 1 - continuations and control transfer

This is the first post of a series about Algebraic Effects and Handlers.

There are 2 ways to approach this topic:

  • Denotational: explain Algebraic Effects in terms of their meaning in mathematics/Category theory
  • Operational: explain the mechanic of Algebraic Effects by showing how they operate under a chosen runtime environment

Both approaches are valuables and give different insights on the topic. However, not everyone (including me), has the prerequisites to grasp the concepts of Category theory and Abstract Algebra. On the other hand, the operational approach is accessible to a much wider audience of programmers even if it doesn't provide the full picture.

@hediet
hediet / main.md
Last active March 11, 2024 15:05
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@wojteklu
wojteklu / clean_code.md
Last active May 12, 2024 08:31
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@cobalamin
cobalamin / HaskellVsElm.md
Last active April 2, 2022 09:19
Elm (0.17) syntax and functionality differences for Haskell programmers
  • Types are declared with : and not ::, and the consing operator conversely is :: instead of :
  • No where clauses, only let/in
  • The standard style is different, check http://elm-lang.org/docs/style-guide for reference
  • Multiline strings are a thing with """
  • Haskell's data corresponds to type in Elm, and also, Haskell's type corresponds to Elm's type alias
  • ($) is (<|), but you don't use it all that much – Elm people like the flipped operator (|>) which lets you build something that reads like a pipeline
  • Related: Backticks will likely die soon in favour of functions that have an argument order that lends itself to pipelining with (|>)
  • Also, (.) is (<<), and a flipped version (>>) exists, but I don't see it used that much either
  • (&gt;&gt;=) is not an available operator and would not be polymorphic (no typeclasses, see below), and is instead commonly named SomeType.andThen – e.g. Maybe.andThen : Maybe a -&gt; (a -&gt; Maybe b) -&gt; Maybe b
@parmentf
parmentf / GitCommitEmoji.md
Last active May 11, 2024 05:36
Git Commit message Emoji